-
1. Re: hibernate.hbm2ddl.auto=create-drop per default ??
bendis Sep 22, 2005 6:37 AM (in response to gmichalk)The default Hibernate3 properties are stored at ejb3.deployer/META-INF/persistence.properties. You can change it in this file or in persistence.xml in your .par archive.
Regards,
Bendis -
2. Re: hibernate.hbm2ddl.auto=create-drop per default ??
alexian Sep 23, 2005 10:37 AM (in response to gmichalk)Where can I find a tutorial/documentation to configure Hibernate properly?
I need to know that because if I edit the above property in, for example, "create" only the tables that I created in DBserver will be erased and recreated... so I lose the data again :(
What's the correct configuration? Or where can I find a tutorial? -
3. Re: hibernate.hbm2ddl.auto=create-drop per default ??
dlb Sep 24, 2005 9:13 PM (in response to gmichalk)Try hibernate.hbbm2ddl.auto=update
You can find the documentation here:
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html -
4. Re: hibernate.hbm2ddl.auto=create-drop per default ??
mboni Sep 28, 2005 10:16 AM (in response to gmichalk)I have to agree, this is a very poor choice of a default value.
I wasn't paying attention to this property until my entire development database got dropped. Fortunately, our DBA had a recent backup. -
5. Re: hibernate.hbm2ddl.auto=create-drop per default ??
mboni Sep 28, 2005 11:55 AM (in response to gmichalk)Ok, this is even worse than I imagined.
The default persistence.properties file has the following two lines in it:hibernate.hbm2ddl.auto=create-drop #hibernate.hbm2ddl.auto=create
If you discover, either the hard way or by reading around, that create-drop is a bad choice, the natural reaction is to swap to the commented option instead.
However, create is just as bad. While my tables were not actually dropped, all of the data was removed!
Aaaarrrrggghhh!
I'm now running with both lines commented out, and sincerely wish the hbbm2ddl feature had never been invented. I hope these words of warning will save some other new user several hours of wasted time. -
6. Re: hibernate.hbm2ddl.auto=create-drop per default ??
stalet Oct 11, 2005 3:26 AM (in response to gmichalk)You can also add the property to the persistence xml. So it doesnt clean your data:
<properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties>
-Ståle -
7. Re: hibernate.hbm2ddl.auto=create-drop per default ??
matt10 Aug 3, 2006 10:38 AM (in response to gmichalk)I just hit this as well when I finally connected my entities to the live database.
Aaaaargh! Good job I had a backup.
Can we change the default please?