1.

What is HibernateTemplate class?

Answer»
  • Prior to Hibernate 3.0.1, Spring provided 2 classes namely: HIBERNATEDAOSUPPORT to get the Session from Hibernate and HibernateTemplate for Spring transaction management purposes.
  • However, from Hibernate 3.0.1 ONWARDS, by using HibernateTemplate class we can use SessionFactory getCurrentSession() METHOD to get the CURRENT session and then use it to get the transaction management benefits.
  • HibernateTemplate has the benefit of EXCEPTION translation but that can be achieved easily by using @Repository annotation with service classes.


Discussion

No Comment Found