david wrote:
Read the FAQs. This has been asked many time before.
http://hibernate.bluemars.net/119.html
It might be asked many times before, and I checked the document you recommended. Unfortunately it did append "type=INNODB" after the CREATE statement, but if you look into all the scripts, it appends "type=INNODB" to all statements including "DROP ....".
Although you see the " type=INNODB" appended, you will got surprised that INNODB not generated. It is because only .ddl file you can see the "type=INNODB", but in its real execution, it doesn't append this keyword, so it doesn't work.
I check into the SchemaExport source and revised it to make sure it real executes INNODB table creation. It is just a temporarily revision, I believe you will have better solution.
Here is my revision, please take a look to
Code:
private void execute(boolean script, boolean export, boolean justDrop, boolean format) {
}
In the line 56 of this method, or line 151 of the whole class, you will see
Code:
if (export) statement.executeUpdate( createSQL[j] );
please revise it to
Code:
if (export) {
if (createSQL[j].trim().startsWith("create"))
statement.executeUpdate( createSQL[j] + " type=InnoDB");
else
statement.executeUpdate( createSQL[j]);
}
Maybe it is not a pretty implementation, at least it does work to generate INNODB table.