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

Data tier implementation with Spring

With Spring, you do not need to implement code for obtaining Session objects, starting and committing transactions, and handling Hibernate exceptions. Instead, you use a HibernateTemplate instance to delegate persistence calls to Hibernate, without direct interaction with Hibernate.

Here are some benefits of using Spring in the persistence layer, instead of using direct interaction with Hibernate:

  • With Spring, the HibernateTemplate object interacts with Hibernate. This object removes the boilerplate code from DAO implementations.
  • Any invocation of one of HibernateTemplate's methods throws the generic DataAccessException exception instead of HibernateException (a Hibernate-specific exception).
  • Spring lets us demarcate ...

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