Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MyISAM dialect generates wrong DDL

We use the MyISAM dialect org.hibernate.dialect.MySQLMyISAMDialect to auto generate DDL files based on JPA2 using 3.6.9.Final hibernate provider on a MySQL 5.5 database.

The create SQL file gets generated as 
CREATE TABLE t (i INT) type = MYISAM;
instead of
CREATE TABLE t (i INT) ENGINE = MYISAM;

which causes table creation to fail.

Note: This worked fine in 5.1 and lesser versions. What hibernate provider should I use to get this fixed.

like image 501
priya Avatar asked Jun 07 '26 04:06

priya


1 Answers

It is broken, MySQL dropped support for deprecated "type=" long time ago. There is no working implementation included to Hibernate in the case of MyISAM. For InnoDB there is separate implementation (MySQL5InnoDBDialect).

You have to implement it by yourself, or just pick existing implementation like: http://code.google.com/p/snofyre/source/browse/trunk/snomed-osgi/uk.nhs.cfh.dsp.snomed.persistence/src/main/java/uk/nhs/cfh/dsp/snomed/persistence/orm/MySQL5MyISAMDialect.java

I guess using InnoDB is not option for you? Especially because of lack of transactions MyISAM is not well fitting together with JPA.

like image 98
Mikko Maunu Avatar answered Jun 10 '26 02:06

Mikko Maunu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!