• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HibernateTemplate or HibernateDaoSupport or Hibernate core

 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am starting a new project using Spring and Hibernate.

i have a doubt regarding which approach to follow. HibernateTemplate or HibernateDaoSupport or some core Hibernate way (used in petclinic project).

please suggest.
 
pandya devarshi r
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vikas,

You can use the HibernaeTemplate instead of HibernateDAO support. In HibernateDAO support you need the HibernateTemplate reference using getHibernateTemplate() method.
Additionally implemented the spring/hibernate you can develop your own class which is extends the HibernateTemplate class.
Your class defination is defined in the web.xml file.


Regards,
Devarshi
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vikas sharmaa wrote:i am starting a new project using Spring and Hibernate.

i have a doubt regarding which approach to follow. HibernateTemplate or HibernateDaoSupport or some core Hibernate way (used in petclinic project).

please suggest.


If you are using Hibernate 3.1 or above, I would say neither. Inject a SessionFactory into your DAO/Repositories instead. In these versions of Hibernate you will get no benefit from HibernateTemplate or DaoSupport classes.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic