Package org.springframework.dao.annotation

# Class PersistenceExceptionTranslationAdvisor

java.lang.Object
org.springframework.aop.support.AbstractPointcutAdvisor
org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor

All Implemented Interfaces:
  `Serializable`, `org.springframework.aop.Advisor`, `org.springframework.aop.PointcutAdvisor`, `org.springframework.core.Ordered`

public class PersistenceExceptionTranslationAdvisor extends org.springframework.aop.support.AbstractPointcutAdvisor
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.

Since:
  2.0
Author:
  Rod Johnson, Juergen Hoeller
See Also:
  - `DataAccessException`
  - `PersistenceExceptionTranslator`
  - Serialized Form

## Field Summary

### Fields inherited from interface org.springframework.aop.Advisor

`EMPTY_ADVICE`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator persistenceExceptionTranslator, Class<? extends Annotation> repositoryAnnotationType)`
Create a new PersistenceExceptionTranslationAdvisor.

## Method Summary

Modifier and Type
Method
Description
`org.aopalliance.aop.Advice`
`getAdvice()`
`org.springframework.aop.Pointcut`
`getPointcut()`

### Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor

`equals, getOrder, hashCode, setOrder`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.aop.Advisor

`isPerInstance`

## Constructor Details

### PersistenceExceptionTranslationAdvisor

public PersistenceExceptionTranslationAdvisor(PersistenceExceptionTranslator persistenceExceptionTranslator, Class<? extends Annotation> repositoryAnnotationType)
Create a new PersistenceExceptionTranslationAdvisor.

Parameters:
  `persistenceExceptionTranslator` - the PersistenceExceptionTranslator to use
  `repositoryAnnotationType` - the annotation type to check for

## Method Details

### getAdvice

public org.aopalliance.aop.Advice getAdvice()

### getPointcut

public org.springframework.aop.Pointcut getPointcut()