The end of HibernateTemplate

In a recent interface21 blog So should you still use Spring’s HibernateTemplate, Alef Arendsen explained why HibernateTemplate/JpaTemplate is not needed anymore. His recommendation is to use the Hibernate Session API directly and HibernateDaoSupport is also not necessary since its main purpose in life is to serve HibernateTemplate. In the blog, Alef also referred to @Repository new in Spring 2.0 to enable exception translation when using the Session API.

Using Session API directly does make DAO code much cleaner to look at but is it just a matter of taste?

Trivia: if you recall, the HibernateTemplate pattern caused a spat between the Hibernate/jBoss and Spring camp. The tension emerged again a few days ago on theserverside. Great drama for a bit of fun read…

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply