Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework » dao » support » [javadoc | source]
org.springframework.dao.support
public class: PersistenceExceptionTranslationInterceptor [javadoc | source]
java.lang.Object
   org.springframework.dao.support.PersistenceExceptionTranslationInterceptor

All Implemented Interfaces:
    BeanFactoryAware, org.aopalliance.intercept.MethodInterceptor, InitializingBean

AOP Alliance MethodInterceptor that provides persistence exception translation based on a given PersistenceExceptionTranslator.

Delegates to the given PersistenceExceptionTranslator to translate a RuntimeException thrown into Spring's DataAccessException hierarchy (if appropriate). If the RuntimeException in question is declared on the target method, it is always propagated as-is (with no translation applied).

Constructor:
 public PersistenceExceptionTranslationInterceptor() 
 public PersistenceExceptionTranslationInterceptor(PersistenceExceptionTranslator persistenceExceptionTranslator) 
    Create a new PersistenceExceptionTranslationInterceptor for the given PersistenceExceptionTranslator.
    Parameters:
    persistenceExceptionTranslator - the PersistenceExceptionTranslator to use
 public PersistenceExceptionTranslationInterceptor(ListableBeanFactory beanFactory) 
    Create a new PersistenceExceptionTranslationInterceptor, autodetecting PersistenceExceptionTranslators in the given BeanFactory.
    Parameters:
    beanFactory - the ListableBeanFactory to obtaining all PersistenceExceptionTranslators from
Method from org.springframework.dao.support.PersistenceExceptionTranslationInterceptor Summary:
afterPropertiesSet,   detectPersistenceExceptionTranslators,   invoke,   setBeanFactory,   setPersistenceExceptionTranslator
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.dao.support.PersistenceExceptionTranslationInterceptor Detail:
 public  void afterPropertiesSet() 
 protected PersistenceExceptionTranslator detectPersistenceExceptionTranslators(ListableBeanFactory beanFactory) 
    Detect all PersistenceExceptionTranslators in the given BeanFactory.
 public Object invoke(MethodInvocation mi) throws Throwable 
 public  void setBeanFactory(BeanFactory beanFactory) throws BeansException 
 public  void setPersistenceExceptionTranslator(PersistenceExceptionTranslator pet) 
    Specify the PersistenceExceptionTranslator to use.

    Default is to autodetect all PersistenceExceptionTranslators in the containing BeanFactory, using them in a chain.