Skip to content

Commit

Permalink
Use non deprecated MySQL dialect for Hibernate 6+
Browse files Browse the repository at this point in the history
This commit fixes the Hibernate dialect lookup for MySQL as it was
previously using a deprecated dialect that has been removed in the most
recent Hibernate version.

Closes gh-31889
  • Loading branch information
snicoll committed Dec 22, 2023
1 parent 232225b commit 9f2970b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.Informix10Dialect;
import org.hibernate.dialect.MySQL57Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.Oracle12cDialect;
import org.hibernate.dialect.PostgreSQL95Dialect;
import org.hibernate.dialect.SQLServer2012Dialect;
Expand Down Expand Up @@ -193,14 +194,14 @@ protected Class<?> determineDatabaseDialectClass(Database database) {
default -> null;
};
}
else { // Hibernate 6.2 aligned
else { // Hibernate 6.2+ aligned
return switch (database) {
case DB2 -> DB2Dialect.class;
case DERBY -> org.hibernate.dialect.DerbyDialect.class;
case H2 -> H2Dialect.class;
case HANA -> HANAColumnStoreDialect.class;
case HSQL -> HSQLDialect.class;
case MYSQL -> MySQL57Dialect.class;
case MYSQL -> MySQLDialect.class;
case ORACLE -> Oracle12cDialect.class;
case POSTGRESQL -> org.hibernate.dialect.PostgreSQLDialect.class;
case SQL_SERVER -> SQLServer2012Dialect.class;
Expand Down

0 comments on commit 9f2970b

Please sign in to comment.