Java 类org.springframework.dao.support.PersistenceExceptionTranslationInterceptor 实例源码

项目:lams    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param persistenceExceptionTranslator the PersistenceExceptionTranslator to use
 * @param repositoryAnnotationType the annotation type to check for
 */
public PersistenceExceptionTranslationAdvisor(
        PersistenceExceptionTranslator persistenceExceptionTranslator,
        Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(persistenceExceptionTranslator);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:lams    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param beanFactory the ListableBeanFactory to obtaining all
 * PersistenceExceptionTranslators from
 * @param repositoryAnnotationType the annotation type to check for
 */
PersistenceExceptionTranslationAdvisor(
        ListableBeanFactory beanFactory, Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(beanFactory);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:spring4-understanding    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param persistenceExceptionTranslator the PersistenceExceptionTranslator to use
 * @param repositoryAnnotationType the annotation type to check for
 */
public PersistenceExceptionTranslationAdvisor(
        PersistenceExceptionTranslator persistenceExceptionTranslator,
        Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(persistenceExceptionTranslator);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:spring4-understanding    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param beanFactory the ListableBeanFactory to obtaining all
 * PersistenceExceptionTranslators from
 * @param repositoryAnnotationType the annotation type to check for
 */
PersistenceExceptionTranslationAdvisor(
        ListableBeanFactory beanFactory, Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(beanFactory);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:spring4-understanding    文件:PersistenceExceptionTranslationInterceptorTests.java   
@Override
protected void addPersistenceExceptionTranslation(ProxyFactory pf, PersistenceExceptionTranslator pet) {
    if (AnnotationUtils.findAnnotation(pf.getTargetClass(), Repository.class) != null) {
        DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
        bf.registerBeanDefinition("peti", new RootBeanDefinition(PersistenceExceptionTranslationInterceptor.class));
        bf.registerSingleton("pet", pet);
        pf.addAdvice((PersistenceExceptionTranslationInterceptor) bf.getBean("peti"));
    }
}
项目:class-guard    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param persistenceExceptionTranslator the PersistenceExceptionTranslator to use
 * @param repositoryAnnotationType the annotation type to check for
 */
public PersistenceExceptionTranslationAdvisor(
        PersistenceExceptionTranslator persistenceExceptionTranslator,
        Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(persistenceExceptionTranslator);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:class-guard    文件:PersistenceExceptionTranslationAdvisor.java   
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param beanFactory the ListableBeanFactory to obtaining all
 * PersistenceExceptionTranslators from
 * @param repositoryAnnotationType the annotation type to check for
 */
PersistenceExceptionTranslationAdvisor(
        ListableBeanFactory beanFactory, Class<? extends Annotation> repositoryAnnotationType) {

    this.advice = new PersistenceExceptionTranslationInterceptor(beanFactory);
    this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
项目:class-guard    文件:PersistenceExceptionTranslationInterceptorTests.java   
@Override
protected void addPersistenceExceptionTranslation(ProxyFactory pf, PersistenceExceptionTranslator pet) {
    if (AnnotationUtils.findAnnotation(pf.getTargetClass(), Repository.class) != null) {
        DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
        bf.registerBeanDefinition("peti", new RootBeanDefinition(PersistenceExceptionTranslationInterceptor.class));
        bf.registerSingleton("pet", pet);
        pf.addAdvice((PersistenceExceptionTranslationInterceptor) bf.getBean("peti"));
    }
}