|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.repository.core.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.QueryExecutorMethodInterceptor
This MethodInterceptor intercepts calls to methods of the custom implementation and delegates the to it if
configured. |
Constructor Summary | |
---|---|
RepositoryFactorySupport()
|
Method Summary | ||
---|---|---|
void |
addQueryCreationListener(QueryCreationListener<?> listener)
Adds a QueryCreationListener to the factory to plug in functionality triggered right after creation of
RepositoryQuery instances. |
|
void |
addRepositoryProxyPostProcessor(RepositoryProxyPostProcessor processor)
Adds RepositoryProxyPostProcessor s to the factory to allow manipulation of the ProxyFactory before
the proxy gets created. |
|
abstract
|
getEntityInformation(Class<T> domainClass)
Returns the EntityInformation for the given domain class. |
|
protected QueryLookupStrategy |
getQueryLookupStrategy(QueryLookupStrategy.Key key)
Returns the QueryLookupStrategy for the given QueryLookupStrategy.Key . |
|
protected List<QueryMethod> |
getQueryMethods()
|
|
|
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<?> |
getRepositoryBaseClass(RepositoryMetadata metadata)
Returns the base class backing the actual repository instance. |
|
protected RepositoryInformation |
getRepositoryInformation(RepositoryMetadata metadata,
Class<?> customImplementationClass)
Returns the RepositoryInformation for the given repository interface. |
|
protected abstract Object |
getTargetRepository(RepositoryMetadata metadata)
Create a repository instance as backing for the query proxy. |
|
void |
setBeanClassLoader(ClassLoader classLoader)
|
|
void |
setNamedQueries(NamedQueries namedQueries)
Configures a NamedQueries instance to be handed to the QueryLookupStrategy for query creation. |
|
void |
setQueryLookupStrategyKey(QueryLookupStrategy.Key key)
Sets the strategy of how to lookup a query to execute finders. |
|
protected void |
validate(RepositoryMetadata repositoryMetadata)
|
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)
key
- public void setNamedQueries(NamedQueries namedQueries)
NamedQueries
instance to be handed to the QueryLookupStrategy
for query creation.
namedQueries
- the namedQueries to setpublic void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public void addQueryCreationListener(QueryCreationListener<?> listener)
QueryCreationListener
to the factory to plug in functionality triggered right after creation of
RepositoryQuery
instances.
listener
- public void addRepositoryProxyPostProcessor(RepositoryProxyPostProcessor processor)
RepositoryProxyPostProcessor
s to the factory to allow manipulation of the ProxyFactory
before
the proxy gets created. Note that the RepositoryFactorySupport.QueryExecutorMethodInterceptor
will be added to the proxy
after the RepositoryProxyPostProcessor
s are considered.
processor
- public <T> T getRepository(Class<T> repositoryInterface)
T
- repositoryInterface
-
public <T> T getRepository(Class<T> repositoryInterface, Object customImplementation)
T
- repositoryInterface
- customImplementation
-
protected RepositoryInformation getRepositoryInformation(RepositoryMetadata metadata, Class<?> customImplementationClass)
RepositoryInformation
for the given repository interface.
metadata
- customImplementationClass
-
protected List<QueryMethod> getQueryMethods()
public abstract <T,ID extends Serializable> EntityInformation<T,ID> getEntityInformation(Class<T> domainClass)
EntityInformation
for the given domain class.
T
- the entity typeID
- the id typedomainClass
-
protected abstract Object getTargetRepository(RepositoryMetadata metadata)
metadata
-
protected abstract Class<?> getRepositoryBaseClass(RepositoryMetadata metadata)
getTargetRepository(RepositoryMetadata)
returns an instance of this class.
metadata
-
protected QueryLookupStrategy getQueryLookupStrategy(QueryLookupStrategy.Key key)
QueryLookupStrategy
for the given QueryLookupStrategy.Key
.
key
- can be null
QueryLookupStrategy
to use or null if no queries should be looked up.protected void validate(RepositoryMetadata repositoryMetadata)
|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |