简体   繁体   English

为什么在使用休眠模式时会清除我的表?

[英]Why my Tables get cleared when i use hibernate?

我已经使用了hibernate和oracle来创建了一些项目...我在其中有许多映射..在映射后,当我执行程序时它可以正常工作,但是当我重新执行程序时,我的表就被清除了...任何想法y ?

somewhere in your config you have a property called hibernate.hbm2ddl.auto set to the value create or create-drop . 在配置中的某处,您有一个名为hibernate.hbm2ddl.auto的属性,其值设置为createcreate-drop Just delete that property or assign the value do_nothing . 只需删除该属性或分配值do_nothing

If you set that property to an invalid value (such as do_nothing ), hibernate doesn't do anything. 如果将该属性设置为无效值(例如do_nothing ),则休眠不会执行任何操作。

You can check the documentation of that property here . 您可以在此处查看该属性的文档。

暂无
暂无

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

相关问题 为什么当我单击键盘上的“确定”按钮时清除了我的EditText? - Why my EditText is cleared when I click on “OK” button on the keyboard? 如果不保存文件,为什么会清除我的文件? - Why is my file being cleared if I don't save it? 当数据库中有数据时,为什么在hibernate中会得到NoResultException? - Why do I get NoResultException in hibernate when there is a data in the database? 当我尝试使用我的jsf自定义标记时,为什么会出现错误“前缀[..]未定义”? - Why do I get error “prefix [..] is not defined” when I try to use my jsf custom tag? 当我使用 ddl-auto=create 时,其中一个表不是由 JPA/hibernate 生成的 - One of the tables is not being generated by JPA/hibernate when I use ddl-auto=create 为什么在使用DriverManager.getConnection时我的SQL连接卡住了,没有任何错误? - Why does my SQL connection get stuck when I use DriverManager.getConnection, without any error? 当我使用DriverManager.getConnection时,为什么我的SQL连接会卡住? - Why does my SQL connection get stuck when I use DriverManager.getConnection? 为什么在GET重定向上清除SessionAttributes? - Why do SessionAttributes get cleared on GET redirect? 如果我在 Spring 中运行 Hibernate 请求,为什么会得到 ClassCastException? - Why do I get a ClassCastException if I run my Hibernate Request in Spring? Spring hibernate模板何时使用,为什么? - Spring hibernate template when to use and why?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM