How can I replicate “SHOW TABLES” in Hibernate?

前端 未结 3 637
感动是毒
感动是毒 2021-01-14 05:14

I\'m trying to iterate over all of my tables so I can truncate each one (at the beginning of each of my JBehave tests).

I thought I would be able to:



        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 06:19

    if you want truncate all of your table you can set hibernate.hbm2ddl.auto in hibernate.cfg.xml by value Create.

    create
    

    but if you want just get all table name and truncate some of them this method don't work.

提交回复
热议问题