Well, as you wrote, Hibernate will generate InnoDB tables if you use MySQL5InnoDBDialect:
public class MySQL5InnoDBDialect extends MySQL5Dialect {
public boolean supportsCascadeDelete() {
return true;
}
public String getTableTypeString() {
return " ENGINE=InnoDB";
}
public boolean hasSelfReferentialForeignKeyBug() {
return true;
}
}
, Hibernate ENGINE=InnoDB CREATE TABLE. , .
hbm2ddl , ALTER . 5.7. . :
CREATE DROP . , . , , SQL, java.sql.Statement.execute() (, ALTERs, INSERTS, ..). :
- CREATE DROP :
<hibernate-mapping>
...
<database-object>
<create>CREATE TRIGGER my_trigger ...</create>
<drop>DROP TRIGGER my_trigger</drop>
</database-object>
</hibernate-mapping>
- , CREATE DROP. org.hibernate.mapping.AuxiliaryDatabaseObject.
<hibernate-mapping>
...
<database-object>
<definition class="MyTriggerDefinition"/>
</database-object>
</hibernate-mapping>
, , , .
<hibernate-mapping>
...
<database-object>
<definition class="MyTriggerDefinition"/>
<dialect-scope name="org.hibernate.dialect.Oracle9iDialect"/>
<dialect-scope name="org.hibernate.dialect.Oracle10gDialect"/>
</database-object>
</hibernate-mapping>
: (ab) Hibernate import.sql ALTER.