I have old legacy hibernate (non JPA and only XML based using hbm.xml files for mapping etc) currently used with Spring 5.X. Since I am converting everything to Spring 6 and hence upgrading Hibernate to 6.X or above, JPA is used everywhere. Since it’s difficult to find a direct migration guide from legacy XML based hibernate (which I’m using) to JPA ( the one using Jakarte EE),is the following a good strategy to follow:
1.Since I have already got Spring 5.X MVC stuff converted to Spring 6.X stuff and I am only left with this old XML based Hibernate,I am thinking of taking a step back and stick to Spring 5.X for a while.
-
Then, convert the old XML based Hibernate configuration to JPA (annotation based) based on Spring 5.X.
-
Once I have Spring 5.X working with JPA annotations and running with Tomcat 9 and JDK 17, I can switch to Spring 6.X related branch (where I’ve already converted everything as per Jakarte EE spec from javax) .
-
At last, focus on converting JPA stuff working with Spring 5.X to Hibernate 6.1 or later such that it will work with Jakarte EE by following migration guides like : 6.0 Migration Guide . As I don’t think I am going to find any migration guide which will help me to migrate from legacy hibernate to the recent Jakarta EE versions. Please share if there exists any.
I think directly attacking old hibernate XML based stuff and converting it to Jakarta EE might give me more troubles than following above approach. What do you think? I believe there are some tools out there as well to convert hbm.xml files to annotation based on some research I did.