在配置hibernate.cfg.xml时,若指定数据库方言为:
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
则无法自动创建表,解决办法为将数据库方言设为org.hibernate.dialect.MySQL5InnoDBDialect(支持事务)或org.hibernate.dialect.MySQLDialect(不支持事务)。
在配置hibernate.cfg.xml时,若指定数据库方言为:
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
则无法自动创建表,解决办法为将数据库方言设为org.hibernate.dialect.MySQL5InnoDBDialect(支持事务)或org.hibernate.dialect.MySQLDialect(不支持事务)。