I create a new project based on Spring Boot 3.x, and find that HibernateTemplate has been deprecated ,and the newest hibernate recommend developers user JPA API, but the JPA API can not manage the life-cycle of session , and i want to migrate my old code written by HibernateTemplate API which has managed the life-cycle of hibernate session. So is there any way to help me ? is there any Doc ?
Here are my some scenario examples:
- When I try a transaction, I hope to still manage my transaction through spring’s transaction management annotations.
- And in the same transaction, even if multiple save methods are involved, I hope that the same Hiberante session is used
3.The code should be as small as possible, and the steps of starting a transaction and starting a session are all handled by the proxy class. Similar to what HiberanetTemplate does, users do not need to worry about the life cycle of the session.