What is the intended upgrade path for legacy Hibernate applications?
<p>I recently had the pleasure of being allowed to bump the version of the Hibernate dependency (amongst others) in a medium sized legacy code base (from 3.x to 5.2). The code itself is partially over 10 years old but still in daily use.</p>

<p>So even after increasing the version and porting as much API calls away from now deprecated or even missing areas to their bleeding edge counterparts (finding out how to do a SchemaExport was a particularly fun experience) I still don't see this as a complete migration.</p>

<p>I'm wondering what the intended upgrade path is for legacy users as often enterprise systems will be around for 10 to 15+ years and still at times you need to jump to a newer dependency version to get necessary bugfixes or features.</p>

<p>The following points are somewhat still open:</p>

<ul>
<li><p>There is no clear or automatic way to migrate .hbm.xml mapping information to JPA annotations. I know a manual migration will be very error prone and not all concepts do have clear or obvious counter parts.</p></li>
<li><p>We now get a lot of deprecation warnings (org.hibernate.orm.deprecation) about our usage of the old Criteria API but there is also no clear upgrade path. One can not just re-write the whole db access code of an application to a completely different and more verbose API that will surely behave different at certain edge cases.</p></li>
<li><p>We seem to use a lot of native queries and instances of <code>org.hibernate.transform.ResultTransformer</code> yet the <code>org.hibernate.query.Query#setResultTransformer()</code> seems to be deprecated with no indication of how to work around this.</p></li>
</ul>

<p>In general I find the documentation about deprecation and intended upgrade paths on Hibernate's side a litte scarce. I do understand that it is an Open Source project and that they don't want to maintain old APIs forever but still I'm feeling a little lost and I don't believe this to be the only legacy Java application out there still in use today.</p>