简体   繁体   English

实体管理器正在重新创建表

[英]the entity manager is recreating the tables

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 谢谢

For hibernate, set your hibernate.hbm2ddl.auto propery in persistence.xml to validate. 对于休眠,请在persistence.xml设置hibernate.hbm2ddl.auto属性以进行验证。

For eclipselink, use the eclipselink.ddl-generation property to NONE . 对于eclipselink,请使用eclipselink.ddl-generation属性设置为NONE

This will prevent the EntityManager from dropping the schema with every execution. 这将防止EntityManager在每次执行时都删除架构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM