org.springframework.dao.annotation
public class: PersistenceExceptionTranslationPostProcessor [javadoc |
source]
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
All Implemented Interfaces:
BeanPostProcessor, Ordered, BeanClassLoaderAware, BeanFactoryAware, Serializable
Bean post-processor that automatically applies persistence exception
translation to any bean that carries the
org.springframework.stereotype.Repository annotation,
adding a corresponding
PersistenceExceptionTranslationAdvisor
to the exposed proxy (either an existing AOP proxy or a newly generated
proxy that implements all of the target's interfaces).
Translates native resource exceptions to Spring's
org.springframework.dao.DataAccessException hierarchy.
Autodetects beans that implement the
org.springframework.dao.support.PersistenceExceptionTranslator
interface, which are subsequently asked to translate candidate exceptions.
All of Spring's applicable resource factories implement the
PersistenceExceptionTranslator interface out of the box.
As a consequence, all that is usually needed to enable automatic exception
translation is marking all affected beans (such as DAOs) with the
Repository annotation, along with defining this post-processor
as bean in the application context.
| Methods from org.springframework.aop.framework.ProxyConfig: |
|---|
|
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString |