Hibernate version:
jboss-embed-ejb3-alpha9
None of these properties seems to create tables when populated into the persistence.xml. Any recommendations?
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
Code:
<persistence>
<persistence-unit name="testdb">
<class>com.test.domain.Testtable</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.username" value="user"/>
<property name="hibernate.connection.password" value="password"/>
<property name="hibernate.connection.url" value="jdbc:mysql://myserver/mydatabase"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
</properties>
</persistence-unit>
</persistence>
The table is never created, and when calling the entitymanager.merge(x) method this happens:
ERROR:
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [com.test.domain.Testtable]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:210)