/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Creates a new {@link PersistenceExceptionTranslationRepositoryProxyPostProcessor} using the given * {@link ListableBeanFactory}. * * @param beanFactory must not be {@literal null}. */ public PersistenceExceptionTranslationRepositoryProxyPostProcessor(ListableBeanFactory beanFactory) { Assert.notNull(beanFactory, "BeanFactory must not be null!"); this.interceptor = new PersistenceExceptionTranslationInterceptor(); this.interceptor.setBeanFactory(beanFactory); this.interceptor.afterPropertiesSet(); }
/** * Creates a new {@link TransactionalRepositoryProxyPostProcessor}. */ public TransactionalRepositoryProxyPostProcessor(ListableBeanFactory beanFactory, String transactionManagerName) { Assert.notNull(beanFactory); Assert.notNull(transactionManagerName); this.petInterceptor = new PersistenceExceptionTranslationInterceptor(); this.petInterceptor.setBeanFactory(beanFactory); this.petInterceptor.afterPropertiesSet(); this.transactionInterceptor = new TransactionInterceptor(null, new CustomAnnotationTransactionAttributeSource()); this.transactionInterceptor.setTransactionManagerBeanName(transactionManagerName); this.transactionInterceptor.setBeanFactory(beanFactory); this.transactionInterceptor.afterPropertiesSet(); }