Maybe someone could explain which one to use? When and why?
The javadoc of HibernateTemplate says:
NOTE: As of Hibernate 3.0.1, transactional Hibernate access code can also be coded in plain Hibernate style. Hence, for newly started projects, consider adopting the standard Hibernate3 style of coding data access objects instead, based on SessionFactory.getCurrentSession().
So even Spring tells you not to use Spring's HibernateTemplate anymore. And there is no HibernateTemplate for Hibernate4. The choice should be obvious.
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