How can I get Hibernate (using JPA) to create MySQL InnoDB tables (instead of MyISAM)? I have found solutions that will work when using Hibernate to generate an SQL file to create the tables, but nothing that works "on the fly".
+4
A:
Can't you specify the Hibernate dialect and use org.hibernate.dialect.MySQLInnoDBDialect
Pascal Thivent
2009-09-22 10:34:31
That did the job! Thanks!
David Tinker
2009-09-22 10:39:12
+2
A:
Are you specifying the dialect setting in your hibernate configuration? If not, then Hibernate will attempt to auto-detect the database dialect, and will choose the safest MySQL dialec, which is MySQL 4 MyISAM.
You can give it a specific dialect, by adding this to your hibernate properties:
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
skaffman
2009-09-22 10:35:30