in my p..."> = create no cleanup for existing data

I use

<property name="" value="create" />


in my persistence.xml for my integration test, and when I run the integration test I get

ERROR SchemaExport:386 - Unsuccessful: create table tableName ...
ERROR SchemaExport:387 - Table 'tableName' already exists


but not = create Is it supposed to replace the table if it already exists? Why should I get this error?

BTW this worked as expected last week, so I am really confused as to why I am suddenly getting this error.


source to share

3 answers

I ended up manually writing and executing the SQL statements to delete and recreate the schema, and then it worked as expected again. I never understood why Hibernate wouldn't crash and recreate existing tables, and it hasn't happened again since.



This error confuses me the first time. But the solution is pretty simple. Just change your hibernate.cfg.xml this setting:

<property name="" value="create"/>



<property name="" value="update"/>




The behavior changed in Hibernate 3.7 and was reverted back to 4.x I am assuming .



All Articles