I recently migrated my application from using Hibernate 3.5.4 to 5.2.4. I replaced library jars, made modifications to my code to work with 5.2.4 using legacy bootstrapping, legacy domain model (hbm.xml), HQL and legacy criteria query, and all went well.
Now I'm considering updating my code to use JPA APIs and wondering how to proceed because there are so much code that I can't update all at once.
Do I need to use JPA bootstrapping before using any of JPA APIs? or Can I just use Session for JPA operations because Session extends EntityManager?
Is it okay to mix hibernate queries and JPA queries in a single Session? Does caching mechanism work correctly?
Is there a recommended path for migration order? For example, legacy to JPA bootstrapping first, then hbm.xml to annotation-based, then HQL to JPQL, then legacy criteria query to JPA criteria query... Or is it okay to migrate in any order?