Spring Data Commmons

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

java.lang.Object
  extended by org.springframework.data.repository.support.RepositoryFactoryBeanSupport<T>
Type Parameters:
T - the type of the repository
All Implemented Interfaces:
FactoryBean<T>, InitializingBean
Direct Known Subclasses:
TransactionalRepositoryFactoryBeanSupport

public abstract class RepositoryFactoryBeanSupport<T extends Repository<?,?>>
extends Object
implements FactoryBean<T>, InitializingBean

Adapter for Springs FactoryBean interface to allow easy setup of repository factories via Spring configuration.

Author:
Oliver Gierke

Constructor Summary
RepositoryFactoryBeanSupport()
           
 
Method Summary
 void afterPropertiesSet()
           
protected abstract  RepositoryFactorySupport createRepositoryFactory()
          Create the actual RepositoryFactorySupport instance.
 T getObject()
           
 Class<? extends T> getObjectType()
           
protected  List<RepositoryProxyPostProcessor> getRepositoryPostProcessors()
          Returns all RepositoryProxyPostProcessor to be added to the repository factory to be created.
 boolean isSingleton()
           
 void setCustomImplementation(Object customImplementation)
          Setter to inject a custom repository implementation.
 void setQueryLookupStrategyKey(QueryLookupStrategy.Key queryLookupStrategyKey)
          Set the QueryLookupStrategy.Key to be used.
 void setRepositoryInterface(Class<? extends T> repositoryInterface)
          Setter to inject the repository interface to implement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryFactoryBeanSupport

public RepositoryFactoryBeanSupport()
Method Detail

setRepositoryInterface

public void setRepositoryInterface(Class<? extends T> repositoryInterface)
Setter to inject the repository interface to implement.

Parameters:
repositoryInterface - the repository interface to set

setQueryLookupStrategyKey

public void setQueryLookupStrategyKey(QueryLookupStrategy.Key queryLookupStrategyKey)
Set the QueryLookupStrategy.Key to be used.

Parameters:
queryLookupStrategyKey -

setCustomImplementation

public void setCustomImplementation(Object customImplementation)
Setter to inject a custom repository implementation.

Parameters:
customImplementation -

getObject

public T getObject()
Specified by:
getObject in interface FactoryBean<T extends Repository<?,?>>

getObjectType

public Class<? extends T> getObjectType()
Specified by:
getObjectType in interface FactoryBean<T extends Repository<?,?>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<T extends Repository<?,?>>

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

getRepositoryPostProcessors

protected List<RepositoryProxyPostProcessor> getRepositoryPostProcessors()
Returns all RepositoryProxyPostProcessor to be added to the repository factory to be created. Default implementation will return an empty list.

Returns:

createRepositoryFactory

protected abstract RepositoryFactorySupport createRepositoryFactory()
Create the actual RepositoryFactorySupport instance.

Returns:

Spring Data Commmons

Copyright © 2011. All Rights Reserved.