SpringBoot: 3.2.5 SpringFramework: v6.1.6 Hibernate: 6.4.4


When I start the springboot application I see the warning message in the logs:

WARN --- [           main] org.hibernate.orm.deprecation            153 : HHH90000025: MySQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)

So I tried to remove the configuration entry in applicaiton.properties: spring.jpa.properties.hibernate.dialect, but the warning message still appears after restarting the application.

Then I found the reason through the debugger, this warning message is from Hibernate: https://github.com/hibernate/hibernate-orm/blob/6.4.4/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java#L152-L154

Because there is a configuration content about hibernate.dialect here: https://github.com/hibernate/hibernate-orm/blob/6.4.4/hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/DialectFactoryImpl.java#L85-L88

It is from: https://github.com/spring-projects/spring-framework/blob/b932df6ad25ee570909c3c2c1ed1a60bd49bbb48/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java#L150-L155

It looks like I can't use Hibernate automatic Dialect resolution and it keeps warning me about removing the default configuration.


I'm not sure if it's a good idea to remove this default detection of determineDatabaseDialectClass, and I found this: https://github.com/spring-projects/spring-framework/issues/22326

Comment From: snicoll

Spring Framework does not use an automatic dialect resolution unless you create the EMF yourself or use a database vendor. We can't say for sure how you end up in this situation as you haven't shared what your application is doing.

Please review the recommendation in https://github.com/spring-projects/spring-framework/issues/31889#issuecomment-1867699407. If that doesn't help, please share a small sample we can run ourselves and we can reopen this issue.