|
Spring Data Commmons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.repository.support.RepositoryFactorySupport
public abstract class RepositoryFactorySupport
Factory bean to create instances of a given repository interface. Creates a
proxy implementing the configured repository interface and apply an advice
handing the control to the QueryExecuterMethodInterceptor
. Query
detection strategy can be configured by setting
QueryLookupStrategy.Key
.
Nested Class Summary | |
---|---|
class |
RepositoryFactorySupport.QueryExecuterMethodInterceptor
This MethodInterceptor intercepts calls to methods of the custom
implementation and delegates the to it if configured. |
Constructor Summary | |
---|---|
RepositoryFactorySupport()
|
Method Summary | ||
---|---|---|
protected void |
addRepositoryProxyPostProcessor(RepositoryProxyPostProcessor processor)
Adds RepositoryProxyPostProcessor s to the factory to allow
manipulation of the ProxyFactory before the proxy gets created. |
|
protected abstract QueryLookupStrategy |
getQueryLookupStrategy(QueryLookupStrategy.Key key)
Returns the QueryLookupStrategy for the given QueryLookupStrategy.Key . |
|
|
getRepository(Class<T> repositoryInterface)
Returns a repository instance for the given interface. |
|
|
getRepository(Class<T> repositoryInterface,
Object customImplementation)
Returns a repository instance for the given interface backed by an instance providing implementation logic for custom logic. |
|
protected abstract Class<? extends RepositorySupport> |
getRepositoryClass(Class<?> repositoryInterface)
Determines the base class for the repository to be created. |
|
protected abstract
|
getTargetRepository(Class<T> domainClass,
Class<?> repositoryInterface)
Create a RepositorySupport instance as backing for the query
proxy. |
|
void |
setQueryLookupStrategyKey(QueryLookupStrategy.Key key)
Sets the strategy of how to lookup a query to execute finders. |
|
protected void |
validate(Class<? extends Repository<?,?>> repositoryInterface,
Object customImplementation)
Validates the given repository interface as well as the given custom implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepositoryFactorySupport()
Method Detail |
---|
public void setQueryLookupStrategyKey(QueryLookupStrategy.Key key)
queryLookupStrategy
- the createFinderQueries to setprotected void addRepositoryProxyPostProcessor(RepositoryProxyPostProcessor processor)
RepositoryProxyPostProcessor
s to the factory to allow
manipulation of the ProxyFactory
before the proxy gets created.
Note that the RepositoryFactorySupport.QueryExecuterMethodInterceptor
will be added to the
proxy after the RepositoryProxyPostProcessor
s are
considered.
processor
- public <T extends Repository<?,?>> T getRepository(Class<T> repositoryInterface)
T
- repositoryInterface
-
public <T extends Repository<?,?>> T getRepository(Class<T> repositoryInterface, Object customImplementation)
T
- repositoryInterface
- customImplementation
-
protected abstract <T,ID extends Serializable> RepositorySupport<T,ID> getTargetRepository(Class<T> domainClass, Class<?> repositoryInterface)
RepositorySupport
instance as backing for the query
proxy.
T
- domainClass
-
protected abstract Class<? extends RepositorySupport> getRepositoryClass(Class<?> repositoryInterface)
protected abstract QueryLookupStrategy getQueryLookupStrategy(QueryLookupStrategy.Key key)
QueryLookupStrategy
for the given QueryLookupStrategy.Key
.
key
- can be null
protected void validate(Class<? extends Repository<?,?>> repositoryInterface, Object customImplementation)
repositoryInterface
- customImplementation
-
|
Spring Data Commmons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |