Hibernate 不可以自动创建数据表

来源:互联网 发布:淘宝买东西投诉卖家 编辑:程序博客网 时间:2024/05/16 17:03

日志显示:

ERROR:HHH000388: Unsuccessful: create table NEWS (ID integer not null auto_increment, AUTHOR varchar(255), TITLE varchar(255), DATE datetime, primary key (ID)) type=InnoDB

ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 7


实在配置文件hibernate.cfg.xml中数据库方言配置错误。

修改:将org.hibernate.dialect.MySQLInnoDBDialect修改为org.hibernate.dialect.MySQLDialect

方言放置在:hibernate-release-4.1.1.Final\hibernate-release-4.1.1.Final\project\etc\hibernate.properties中

0 0
原创粉丝点击