Class RepositoryInformationSupport
java.lang.Object
org.springframework.data.repository.core.RepositoryInformationSupport
- All Implemented Interfaces:
RepositoryInformation,RepositoryMetadata
Common base class for
RepositoryInformation that delays resolution of RepositoryMetadata and the
repository base to the latest possible time.- Since:
- 3.0
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryInformationSupport(Supplier<RepositoryMetadata> metadata, Supplier<Class<?>> repositoryBaseClass) -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of types the repository shall be discoverable for when trying to look up a repository by domain type.ReturnsCrudMethodsmeta information for the repository.Class<?>Returns the raw domain class the repository is declared for.Returns theTypeInformationof the domain type the repository is declared to manage.Class<?>Returns the raw id class the given class is declared for.Returns theTypeInformationof the id type of the repository.Returns all methods considered to be query methods.Class<?>Returns the base class to be used to create the proxy backing instance.Class<?>Returns the repository interface.Class<?>getReturnedDomainClass(Method method) Returns the domain class returned by the givenMethod.getReturnType(Method method) Returns the typeMethodreturn type as it is declared in the repository.booleanReturns if the configured repository interface has custom methods, that might have to be delegated to a custom implementation.booleanReturns whether the repository is a paging one.protected booleanisQueryAnnotationPresentOn(Method method) Checks whether the given method contains a custom store specific query annotation annotated withQueryAnnotation.booleanisQueryMethod(Method method) Returns whether the given method is a query method.protected booleanisQueryMethodCandidate(Method method) Checks whether the given method is a query method candidate.booleanReturns whether the repository is a reactive one, i.e. if it uses reactive types in one of its methods.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.repository.core.RepositoryInformation
getTargetClassMethod, hasQueryMethods, isBaseClassMethod, isCustomMethodMethods inherited from interface org.springframework.data.repository.core.RepositoryMetadata
getFragments
-
Constructor Details
-
RepositoryInformationSupport
public RepositoryInformationSupport(Supplier<RepositoryMetadata> metadata, Supplier<Class<?>> repositoryBaseClass)
-
-
Method Details
-
getQueryMethods
Description copied from interface:RepositoryInformationReturns all methods considered to be query methods.- Specified by:
getQueryMethodsin interfaceRepositoryInformation- Returns:
-
getIdType
Description copied from interface:RepositoryMetadataReturns the raw id class the given class is declared for.- Specified by:
getIdTypein interfaceRepositoryMetadata- Returns:
- the raw id class of the entity managed by the repository.
-
getDomainType
Description copied from interface:RepositoryMetadataReturns the raw domain class the repository is declared for.- Specified by:
getDomainTypein interfaceRepositoryMetadata- Returns:
- the raw domain class the repository is handling.
-
getRepositoryInterface
Description copied from interface:RepositoryMetadataReturns the repository interface.- Specified by:
getRepositoryInterfacein interfaceRepositoryMetadata- Returns:
-
getReturnType
Description copied from interface:RepositoryMetadataReturns the typeMethodreturn type as it is declared in the repository. Considers suspended methods and does not unwrap component types but leaves those for further inspection.- Specified by:
getReturnTypein interfaceRepositoryMetadata- Returns:
-
getReturnedDomainClass
Description copied from interface:RepositoryMetadataReturns the domain class returned by the givenMethod. In contrast toRepositoryMetadata.getReturnType(Method), this method extracts the type fromCollections andPageas well.- Specified by:
getReturnedDomainClassin interfaceRepositoryMetadata- Returns:
- See Also:
-
getCrudMethods
Description copied from interface:RepositoryMetadataReturnsCrudMethodsmeta information for the repository.- Specified by:
getCrudMethodsin interfaceRepositoryMetadata- Returns:
-
isPagingRepository
public boolean isPagingRepository()Description copied from interface:RepositoryMetadataReturns whether the repository is a paging one.- Specified by:
isPagingRepositoryin interfaceRepositoryMetadata- Returns:
-
getAlternativeDomainTypes
Description copied from interface:RepositoryMetadataReturns the set of types the repository shall be discoverable for when trying to look up a repository by domain type.- Specified by:
getAlternativeDomainTypesin interfaceRepositoryMetadata- Returns:
- the set of types the repository shall be discoverable for when trying to look up a repository by domain type, must not be null.
- See Also:
-
isReactiveRepository
public boolean isReactiveRepository()Description copied from interface:RepositoryMetadataReturns whether the repository is a reactive one, i.e. if it uses reactive types in one of its methods.- Specified by:
isReactiveRepositoryin interfaceRepositoryMetadata- Returns:
-
getRepositoryBaseClass
Description copied from interface:RepositoryInformationReturns the base class to be used to create the proxy backing instance.- Specified by:
getRepositoryBaseClassin interfaceRepositoryInformation- Returns:
-
isQueryMethod
Description copied from interface:RepositoryInformationReturns whether the given method is a query method.- Specified by:
isQueryMethodin interfaceRepositoryInformation- Returns:
-
getDomainTypeInformation
Description copied from interface:RepositoryMetadataReturns theTypeInformationof the domain type the repository is declared to manage. Will never be null.- Specified by:
getDomainTypeInformationin interfaceRepositoryMetadata- Returns:
- the domain class the repository is handling.
-
getIdTypeInformation
Description copied from interface:RepositoryMetadataReturns theTypeInformationof the id type of the repository.- Specified by:
getIdTypeInformationin interfaceRepositoryMetadata- Returns:
- the
TypeInformationclass of the identifier of the entity managed by the repository. Will never be null.
-
hasCustomMethod
public boolean hasCustomMethod()Description copied from interface:RepositoryInformationReturns if the configured repository interface has custom methods, that might have to be delegated to a custom implementation. This is used to verify repository configuration.- Specified by:
hasCustomMethodin interfaceRepositoryInformation- Returns:
-
isQueryAnnotationPresentOn
Checks whether the given method contains a custom store specific query annotation annotated withQueryAnnotation. The method-hierarchy is also considered in the search for the annotation.- Parameters:
method-- Returns:
-
isQueryMethodCandidate
Checks whether the given method is a query method candidate.- Parameters:
method-- Returns:
-