Hibernate与Mysql 5.5创建表出错--table doesn't exist

1.<property name="hbm2ddl.auto">create</property>

被注释掉,或者没写,或者中间不是create


2.表中有关键字,如
order,level,address,degree等。


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

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

MysqlDialect这个是比较老的,如果你是用的mysql5,最好是用MySQL5Dialect,后面的方言是针对mysql5的一些新特性做了一些优化的,更快了效率,Mysql5Dialect是继承了MysqlDialect的所以MysqlDialect能干的事 Mysql5Dialect都能干。

4.在配置文件中不小心写了两个同名属性

猜你喜欢

转载自blog.csdn.net/zhw0596/article/details/80484231
今日推荐