title: Hibernate 5.2 Mixing Native and JPA APIs
body: <p>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.</p>
  
  <p>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.</p>
  
  <ol>
  <li><p>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?</p></li>
  <li><p>Is it okay to mix hibernate queries and JPA queries in a single Session? Does caching mechanism work correctly?</p></li>
  <li><p>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?</p></li>
  </ol>