Reputation: 1766
I am trying to update my existing DB schema automatically with JPA-based app (I am using Hibernate as a Persistence provider). What I did is that I have positioned my hbm2dll param to "update" like this in the persistence.xml :
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
...
</properties>
But it seems that Hibernate can not handle the schema generation.
Can you please tell me how I can automatically update my running DB schema with JPA/Hibernate if any other option than the hbm2dll is available?
Upvotes: 2
Views: 6531
Reputation: 1596
Your setting is correct ,but database must be created manually.Hibernate will create tables.And you can also set value to create,update .
Upvotes: 0
Reputation: 47913
Don't do that in production. Write your schema manually and then maintain it using Liquibase or something similar.
Upvotes: 1