Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HibernateTemplate or HibernateDaoSupport or Hibernate core  RSS feed

 
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.
 
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
 
ranger
Sheriff
Posts: 17314
11
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
Boost this thread!