I am currently upgrading my existing project Changes are:
JDK 8 --> JDK 17
JSF 2.2 --> Jakarta Faces 4
Glassfish 4.1 --> 7.0.11
JPA 2.1 --> JPA 3.1
I also need to change to change the hibernate version. Currently, I am using Hibernate 4.3.5.Final
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.5.Final</version>
<scope>compile</scope>
</dependency>
I have tried Hibernate 6.1.7.Final, It shows that the minimum Dialect is 5.7. I may be wrong and have no concrete statement for changes regarding the minimum MySQL version required hibernate version-wise.
My question is, What is the latest version of Hibernate that supports MySQL 5.6? Any help is highly appreciated.
Checking the sources of org.hibernate.dialect.MySQLDialect
, one can look for this line
private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 5, 7 );
The link to this code file is here: https://github.com/hibernate/hibernate-orm/blob/6.1/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java
You can then pick the branch in the github UI and quickly examine what version is supported by each source branch.
The first branch that the MINIMUM_VERSION
is defined is Hibernate 6.1, and in that branch it defines the minimum version as 5.7.
Hibernate 6.0 does not have this static property. The class comment says it is for "MySQL 5 and above".
Hibernate 5.6 has a class comment that it is for "MySQL (prior to 5.x)".
According to https://hibernate.org/orm/documentation/getting-started/, Hibernate 6.0 is currently end-of-life, and 5.6 is currently on limited support.