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

Spring exception translation

Spring provides its own exception hierarchy, which sits on the exception hierarchies of the O/R mapping tools it supports. It catches any database exception or error that might be thrown through JDBC, or the underlying O/R mapping tool, and translates the caught exception to a corresponding exception in its own hierarchy. The Spring exception hierarchy is defined as a subclass of org.springframework.dao.DataAccessException. Spring catches any exception thrown in the underlying persistence technology and wraps it in a DataAccessException instance. The DataAccessException object is an unchecked exception, because it extends RuntimeException and you do not need to catch it if you do not want to.

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