Home > Database > Mysql Tutorial > body text

How to Create MySQL InnoDB Tables with Hibernate?

Susan Sarandon
Release: 2024-11-09 03:39:01
Original
499 people have browsed it

How to Create MySQL InnoDB Tables with Hibernate?

Creating MySQL InnoDB Tables with Hibernate

When utilizing Hibernate with JPA, you may encounter the need to create MySQL tables with the InnoDB engine instead of the default MyISAM. To achieve this dynamically and not through SQL file generation, consider the following solution:

Solution:

Specify the Hibernate dialect using the property:

hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
Copy after login

For MySQL versions greater than 5.1, use:

hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
Copy after login

By setting this dialect, Hibernate will automatically create tables with the InnoDB engine, ensuring the desired storage properties and improved performance.

The above is the detailed content of How to Create MySQL InnoDB Tables with Hibernate?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template