Spring Data Commons

org.springframework.data.repository.core.support
Class RepositoryFactoryBeanSupport<T extends Repository<S,ID>,S,ID extends java.io.Serializable>

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

public abstract class RepositoryFactoryBeanSupport<T extends Repository<S,ID>,S,ID extends java.io.Serializable>
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, RepositoryFactoryInformation<S,ID>, org.springframework.beans.factory.FactoryBean<T>

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.
 EntityInformation<S,ID> getEntityInformation()
          Returns EntityInformation the repository factory is using.
 T getObject()
           
 java.lang.Class<? extends T> getObjectType()
           
 java.lang.Class<? extends T> getRepositoryInterface()
          Returns the interface of the Repository the factory will create.
 boolean isSingleton()
           
 void setCustomImplementation(java.lang.Object customImplementation)
          Setter to inject a custom repository implementation.
 void setNamedQueries(NamedQueries namedQueries)
          Setter to inject a NamedQueries instance.
 void setQueryLookupStrategyKey(QueryLookupStrategy.Key queryLookupStrategyKey)
          Set the QueryLookupStrategy.Key to be used.
 void setRepositoryInterface(java.lang.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(java.lang.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(java.lang.Object customImplementation)
Setter to inject a custom repository implementation.

Parameters:
customImplementation -

setNamedQueries

public void setNamedQueries(NamedQueries namedQueries)
Setter to inject a NamedQueries instance.

Parameters:
namedQueries - the namedQueries to set

getEntityInformation

public EntityInformation<S,ID> getEntityInformation()
Description copied from interface: RepositoryFactoryInformation
Returns EntityInformation the repository factory is using.

Specified by:
getEntityInformation in interface RepositoryFactoryInformation<S,ID extends java.io.Serializable>
Returns:

getRepositoryInterface

public java.lang.Class<? extends T> getRepositoryInterface()
Description copied from interface: RepositoryFactoryInformation
Returns the interface of the Repository the factory will create.

Specified by:
getRepositoryInterface in interface RepositoryFactoryInformation<S,ID extends java.io.Serializable>
Returns:

getObject

public T getObject()
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<T extends Repository<S,ID>>

getObjectType

public java.lang.Class<? extends T> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<T extends Repository<S,ID>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<T extends Repository<S,ID>>

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

createRepositoryFactory

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

Returns:

Spring Data Commons

Copyright © 2012. All Rights Reserved.