MySql的数据库方言问题

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

你可能感兴趣的:(MySql的数据库方言问题)