MySql的数据库方言问题

在使用hibernate将po(一般对象类)转化为数据库表时,如果mysql的版本为5.0之前的,则方言写为:<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>。如果是5.0之后的,则为<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>。否则会报错: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 1。

在hibernate生成的建表语句里,对于mysql5.0之后的版本,将type=InnoDB改为engine=InnoDB

原文地址:https://www.cnblogs.com/ncwuwsh/p/3480026.html