hibernate table does not exist error

please change the code from:

<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

to :

<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>

try it.


Is there a space between "property" and "name"?

<propertyname="hibernate.hbm2ddl.auto">create</property>

If not, then that's probably the issue. Also, what do you mean that it fixes when you "reboot the MySQL database"? Does it means you just restart the MySQL server, or it means that you need to manually recreate the table? Also, if the XML excerpt above indeed contains an space between "property" and "name", please provide also the except for the hibernate logs, specially the part that it lists all the properties it identified.


I don't believe using create will update an in-place schema to re-add the table that you dropped. Try:

<property name="hibernate.hbm2ddl.auto">update</property>

This is create a schema if one doesn't exist, and attempt to modify an existing one to match the mapping you have defined.

Also, read this question about all the possible values.

Tags:

Hibernate