Top Description Fields Constructors Methods
org.springframework.dao.annotation

public Class PersistenceExceptionTranslationAdvisor

extends AbstractPointcutAdvisor
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.lang.annotation.Annotation, org.aopalliance.aop.Advice, org.springframework.aop.Pointcut, org.springframework.aop.support.AbstractPointcutAdvisor, org.springframework.aop.support.annotation.AnnotationMatchingPointcut, org.springframework.beans.factory.ListableBeanFactory, org.springframework.dao.support.PersistenceExceptionTranslationInterceptor, .PersistenceExceptionTranslator

Spring AOP exception translation aspect for use at Repository or DAO layer level. Translates native persistence exceptions into Spring's DataAccessException hierarchy, based on a given PersistenceExceptionTranslator.
Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
org.springframework.dao.DataAccessException, org.springframework.dao.support.PersistenceExceptionTranslator

Field Summary

Modifier and TypeField and Description
private final PersistenceExceptionTranslationInterceptor
private final AnnotationMatchingPointcut

Constructor Summary

AccessConstructor and Description
public
PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator
the PersistenceExceptionTranslator to use
persistenceExceptionTranslator
,
Class<? extends Annotation>
the annotation type to check for
repositoryAnnotationType
)

Create a new PersistenceExceptionTranslationAdvisor.

pack-priv
PersistenceExceptionTranslationAdvisor(ListableBeanFactory
the ListableBeanFactory to obtaining all PersistenceExceptionTranslators from
beanFactory
,
Class<? extends Annotation>
the annotation type to check for
repositoryAnnotationType
)

Create a new PersistenceExceptionTranslationAdvisor.

Method Summary

Modifier and TypeMethod and Description
public Advice
getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect.
public Pointcut
getPointcut()

Implements org.springframework.aop.PointcutAdvisor.getPointcut.

Get the Pointcut that drives this advisor.
Inherited from org.springframework.aop.support.AbstractPointcutAdvisor:
equalsgetOrderhashCodesetOrder

Field Detail

adviceback to summary
private final PersistenceExceptionTranslationInterceptor advice
pointcutback to summary
private final AnnotationMatchingPointcut pointcut

Constructor Detail

PersistenceExceptionTranslationAdvisorback to summary
public PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator persistenceExceptionTranslator, Class<? extends Annotation> repositoryAnnotationType)

Create a new PersistenceExceptionTranslationAdvisor.

Parameters
persistenceExceptionTranslator:PersistenceExceptionTranslator

the PersistenceExceptionTranslator to use

repositoryAnnotationType:Class<? extends Annotation>

the annotation type to check for

PersistenceExceptionTranslationAdvisorback to summary
pack-priv PersistenceExceptionTranslationAdvisor(ListableBeanFactory beanFactory, Class<? extends Annotation> repositoryAnnotationType)

Create a new PersistenceExceptionTranslationAdvisor.

Parameters
beanFactory:ListableBeanFactory

the ListableBeanFactory to obtaining all PersistenceExceptionTranslators from

repositoryAnnotationType:Class<? extends Annotation>

the annotation type to check for

Method Detail

getAdviceback to summary
public Advice getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Doc from org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:Advice

the advice that should apply if the pointcut matches

Annotations
@Override
getPointcutback to summary
public Pointcut getPointcut()

Implements org.springframework.aop.PointcutAdvisor.getPointcut.

Doc from org.springframework.aop.PointcutAdvisor.getPointcut.

Get the Pointcut that drives this advisor.

Annotations
@Override