I am trying to understand the benefit which HibernateDAOSupport provides over HibernateTemplate. HibernateTemplate pretty much does everything. Then why do we need to extend HibernateDAOSupport and getHibernateTemplate and do the operations rather than injecting the hibernateTemplate and do the operations. What is the benefit we get when the DAO classes extend HibernateDAOSupport.
I know that it is not recommended to use HibernateDAOSupport and HibernateTemplate anymore but just trying to understand the difference.
This is a little guess work after skimming through the API:
It looks like at first there was the HibernateTemplate which hid the session completely and if you needed access to the Session DaoSupport would offer you that.
From HibernateDaoSupport JavaDoc:
But the
getSession
method in DaoSupport is now deprecated for HibernateSession, which has basically the same method now. So the only thing left in DaoSupport, which you don't get in the Template seems to be releaseSession which is also deprecated, but I can't find it in HibernateTemplate API.tl;dr;
These are just left overs from an age long ago. Don't worry to much if you aren't an archaeologist.