Example usage for org.springframework.dao.support PersistenceExceptionTranslationInterceptor PersistenceExceptionTranslationInterceptor

List of usage examples for org.springframework.dao.support PersistenceExceptionTranslationInterceptor PersistenceExceptionTranslationInterceptor

Introduction

In this page you can find the example usage for org.springframework.dao.support PersistenceExceptionTranslationInterceptor PersistenceExceptionTranslationInterceptor.

Prototype

public PersistenceExceptionTranslationInterceptor() 

Source Link

Document

Create a new PersistenceExceptionTranslationInterceptor.

Usage

From source file:org.synyx.hades.dao.orm.TransactionalDaoProxyPostProcessor.java

/**
 * Creates a new {@link TransactionalDaoProxyPostProcessor}.
 *//* w  w  w  .jav  a2 s  .c o  m*/
public TransactionalDaoProxyPostProcessor(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 AnnotationTransactionAttributeSource());
    this.transactionInterceptor.setTransactionManagerBeanName(transactionManagerName);
    this.transactionInterceptor.setBeanFactory(beanFactory);
    this.transactionInterceptor.afterPropertiesSet();
}

From source file:org.domi.config.security.prepost.TransactionalRepositoryProxyPostProcessor.java

/**
 * Creates a new {@link TransactionalRepositoryProxyPostProcessor}.
 *//*  w w  w . j  a v a2 s .  c o  m*/
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();
}

From source file:com.sinosoft.one.data.jpa.repository.support.OneTransactionalRepositoryProxyPostProcessor.java

/**
 * Creates a new {@link OneTransactionalRepositoryProxyPostProcessor}.
 *//*from  w  ww .ja  v a  2  s.  c  o m*/
public OneTransactionalRepositoryProxyPostProcessor(ListableBeanFactory beanFactory,
        String transactionManagerName, SqlQueries sqlQueries) {

    Assert.notNull(beanFactory);
    Assert.notNull(transactionManagerName);

    this.petInterceptor = new PersistenceExceptionTranslationInterceptor();
    this.petInterceptor.setBeanFactory(beanFactory);
    this.petInterceptor.afterPropertiesSet();

    this.transactionInterceptor = new TransactionInterceptor(null,
            new OneCustomAnnotationTransactionAttributeSource(sqlQueries));
    this.transactionInterceptor.setTransactionManagerBeanName(transactionManagerName);
    this.transactionInterceptor.setBeanFactory(beanFactory);
    this.transactionInterceptor.afterPropertiesSet();
}