Class Repositories
java.lang.Object
org.springframework.data.repository.support.Repositories
Wrapper class to access repository instances obtained from a
ListableBeanFactory.- Author:
- Oliver Gierke, Thomas Darimont, Thomas Eizinger, Christoph Strobl, Alessandro Nistico, Johannes Englmeier
-
Constructor Summary
ConstructorsConstructorDescriptionRepositories(ListableBeanFactory factory) Creates a newRepositoriesinstance by looking up the repository instances and meta information from the givenListableBeanFactory. -
Method Summary
Modifier and TypeMethodDescription<T,S> EntityInformation<T, S> getEntityInformationFor(Class<?> domainClass) Returns theEntityInformationfor the given domain class.PersistentEntity<?,?> getPersistentEntity(Class<?> domainClass) Returns thePersistentEntityfor the given domain class.getQueryMethodsFor(Class<?> domainClass) Returns theQueryMethods contained in the repository managing the given domain class.getRepositoryFor(Class<?> domainClass) Returns the repository managing the given domain class.getRepositoryInformation(Class<?> repositoryInterface) Returns theRepositoryInformationfor the given repository interface.getRepositoryInformationFor(Class<?> domainClass) Returns theRepositoryInformationfor the given domain class.getRequiredRepositoryInformation(Class<?> domainType) Returns theRepositoryInformationfor the given domain type.booleanhasRepositoryFor(Class<?> domainClass) Returns whether we have a repository instance registered to manage instances of the given domain class.iterator()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Repositories
Creates a newRepositoriesinstance by looking up the repository instances and meta information from the givenListableBeanFactory.- Parameters:
factory- must not be null.
-
-
Method Details
-
hasRepositoryFor
Returns whether we have a repository instance registered to manage instances of the given domain class. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
-
getRepositoryFor
Returns the repository managing the given domain class. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
-
getEntityInformationFor
Returns theEntityInformationfor the given domain class. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
- See Also:
-
getRepositoryInformationFor
Returns theRepositoryInformationfor the given domain class. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
- the
RepositoryInformationfor the given domain class or Optional#empty() if no repository registered for this domain class. - See Also:
-
getRequiredRepositoryInformation
Returns theRepositoryInformationfor the given domain type. The givendomainTypeis unwrapped to the actual user class if necessary.- Parameters:
domainType- must not be null.- Returns:
- the
RepositoryInformationfor the given domain type. - Throws:
IllegalArgumentException- in case noRepositoryInformationcould be found for the given domain type.- See Also:
-
getRepositoryInformation
Returns theRepositoryInformationfor the given repository interface.- Parameters:
repositoryInterface- must not be null.- Returns:
- the
RepositoryInformationfor the given repository interface or null there's no repository instance registered for the given interface. - Since:
- 1.12
-
getPersistentEntity
Returns thePersistentEntityfor the given domain class. Might return null in case the module storing the given domain class does not support the mapping subsystem. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
- the
PersistentEntityfor the given domain class or null if no repository is registered for the domain class or the repository is not backed by aMappingContextimplementation. - See Also:
-
getQueryMethodsFor
Returns theQueryMethods contained in the repository managing the given domain class. The givendomainClassis unwrapped to the actual user class if necessary.- Parameters:
domainClass- must not be null.- Returns:
- See Also:
-
iterator
-