2017  Kodetalk | Feedback | Privacy Policy | Terms | About

why HibernateDaoSupport is not recommended?

i am working on  Hibernate 3.5 and Spring 3 recently.

I"m fairly new with Hibernate and thought the HibernateDaoSupport class in Spring made it nice and easy to use Hibernate with my domain classes.

However, when i was searching, I saw some one mention that the HibernateDaoSupport is not the best way to use Spring and Hibernate.

  • Why is not recommended?

Because from Hibernate 3.0.1 you don't need it any more .

you can write a code against a plain Hibernate API while using Spring-managed transactions.

All you need is to configure Spring transaction support, inject SessionFactory and call getCurrentSession() on it when you need to work with session.

Answer is