O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refactoring DAO classes to use Spring

Spring provides distinct DAO base classes for the different data-access technologies it supports. For instance, Spring provides HibernateDaoSupport for Hibernate, SqlMapClientDaoSupport for iBATIS SQL Maps, and JdoDaoSupport for JDO. These classes wrap the common properties and methods that are required in all DAO implementation subclasses.

When you use Hibernate with Spring, the DAO classes extend the Spring org.springframework.orm.hibernate3.support.HibernateDaoSupport class. This class wraps an instance of org.springframework.orm.hibernate3.HibernateTemplate, which in turn wraps an org.hibernate.SessionFactory instance. As you will soon see in this chapter, extending the HibernateDaoSupport class lets you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required