Home >Database >Mysql Tutorial >How to Configure Hibernate to Create InnoDB Tables in MySQL?
Question:
How can Hibernate, when used with JPA, be configured to create MySQL InnoDB tables?
Answer:
To specify the database dialect for Hibernate and force it to create InnoDB tables, you can use the following configurations:
For MySQL versions prior to 5.1:
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
For MySQL versions 5.1 and above:
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
This approach allows you to modify the table creation process dynamically, without the need to generate separate SQL scripts.
The above is the detailed content of How to Configure Hibernate to Create InnoDB Tables in MySQL?. For more information, please follow other related articles on the PHP Chinese website!