实体管理器正在重新创建表
我的问题是,每次执行应用程序时,实体管理器都会删除表并创建它们。 我想从数据库中检索数据,那么如何防止它创建新表?谢谢
My problem is with the entity manager every time i excute my application it drops tables and the creates them.
I want to retrive data from the data base so how to prevent it from creating new tables? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 hibernate,请在
persistence.xml
中设置hibernate.hbm2ddl.auto
属性进行验证。对于 eclipselink,请使用
eclipselink.ddl- Generation
属性为NONE
。这将防止 EntityManager 在每次执行时删除架构。
For hibernate, set your
hibernate.hbm2ddl.auto
propery inpersistence.xml
to validate.For eclipselink, use the
eclipselink.ddl-generation
property toNONE
.This will prevent the EntityManager from dropping the schema with every execution.