How can I get EclipseLink to create MySQL InnoDB tables?

It generates MyISAM tables by default. I do not want him to create a DDL script and then edit this if I can avoid it. I would also like to avoid changing the default table type of my MySQL installation if I cannot do this for an online single database. Any ideas?

+4
source share
3 answers

It is impossible to see any method other than editing scripts, or to set the default type in MySQL.

There is a mistake for this, please vote for it,

https://bugs.eclipse.org/bugs/show_bug.cgi?id=214519

EclipseLink supports creating tables with postFix, such as engine = InnoDB, in its TableDefinition setCreationSuffix (), but does not support any way to create it and does not provide a binding to the event or platform to generate the default table (which will be very useful).

You can use the EclipseLink DefaultTableGenerator yourself to create your own tables in SessionCustomizer. You would call generateDefaultTableCreator () and then through its TableDefitions add the suffix InnoDB and then tell it to create the tables. All classes are in the package org.eclipse.persistence.tools.schemaframework.

+4
source

In EclipseLink 2.4:

eclipselink.ddl.default-table-suffix 

does not work.

In v2.4 you should use:

 eclipselink.ddl-generation.table-creation-suffix 
+1
source