Spring Data Commmons

org.springframework.data.repository.support
Class TransactionalRepositoryFactoryBeanSupport<T extends Repository<?,?>>

java.lang.Object
  extended by org.springframework.data.repository.support.RepositoryFactoryBeanSupport<T>
      extended by org.springframework.data.repository.support.TransactionalRepositoryFactoryBeanSupport<T>
All Implemented Interfaces:
BeanFactoryAware, FactoryBean<T>, InitializingBean

public abstract class TransactionalRepositoryFactoryBeanSupport<T extends Repository<?,?>>
extends RepositoryFactoryBeanSupport<T>
implements BeanFactoryAware

Extension of RepositoryFactoryBeanSupport to add transactional capabilities to the repository proxy. Will register a TransactionalRepositoryProxyPostProcessor that in turn adds a TransactionInterceptor to the repository proxy to be created.

Author:
Oliver Gierke

Constructor Summary
TransactionalRepositoryFactoryBeanSupport()
           
 
Method Summary
 List<RepositoryProxyPostProcessor> getRepositoryPostProcessors()
          Returns all RepositoryProxyPostProcessor to be added to the repository factory to be created.
 void setBeanFactory(BeanFactory beanFactory)
           
 void setTransactionManager(String transactionManager)
          Setter to configure which transaction manager to be used.
 
Methods inherited from class org.springframework.data.repository.support.RepositoryFactoryBeanSupport
afterPropertiesSet, createRepositoryFactory, getObject, getObjectType, isSingleton, setCustomImplementation, setQueryLookupStrategyKey, setRepositoryInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalRepositoryFactoryBeanSupport

public TransactionalRepositoryFactoryBeanSupport()
Method Detail

setTransactionManager

public void setTransactionManager(String transactionManager)
Setter to configure which transaction manager to be used. We have to use the bean name explicitly as otherwise the qualifier of the Transactional annotation is used. By explicitly defining the transaction manager bean name we favour let this one be the default one chosen.

Parameters:
transactionManager -

getRepositoryPostProcessors

public List<RepositoryProxyPostProcessor> getRepositoryPostProcessors()
Description copied from class: RepositoryFactoryBeanSupport
Returns all RepositoryProxyPostProcessor to be added to the repository factory to be created. Default implementation will return an empty list.

Overrides:
getRepositoryPostProcessors in class RepositoryFactoryBeanSupport<T extends Repository<?,?>>
Returns:

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Specified by:
setBeanFactory in interface BeanFactoryAware

Spring Data Commmons

Copyright © 2011. All Rights Reserved.