Spring's hibernate4 package appears to have done away with HibernateTemplate and HibernateDaoSupport. I'm in the process of upgrading Hibernate from 3 to 4 in my Spring app and I have a fair few subclasses of Spring's HibernateDaoSupport and a couple of Hibernate callbacks through HibernateTemplate. Perhaps I'm not using the right search terms, but I can't find any info in the reference docs on how I should be refactoring these to "use plain hibernate daos as explained in the reference guide". Can anyone help point me in the right direction?
The javadoc of HibernateTemplate explains it. You should use sessionFactory.getCurrentSession()
to get a session, and use the native Hibernate Session API directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With