Module spring.data.commons
Class AbstractRepositoryMetadata
java.lang.Object
org.springframework.data.repository.core.support.AbstractRepositoryMetadata
- All Implemented Interfaces:
RepositoryMetadata
- Direct Known Subclasses:
AnnotationRepositoryMetadata,DefaultRepositoryMetadata
Base class for
RepositoryMetadata implementations.- Author:
- Oliver Gierke, Thomas Darimont, Jens Schauder, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRepositoryMetadata(Class<?> repositoryInterface) Creates a newAbstractRepositoryMetadata. -
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.static RepositoryMetadatagetMetadata(Class<?> repositoryInterface) Creates a newRepositoryMetadatafor the given repository interface.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 whether the repository is a paging one.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.RepositoryMetadata
getDomainType, getDomainTypeInformation, getFragments, getIdType, getIdTypeInformation
-
Constructor Details
-
AbstractRepositoryMetadata
Creates a newAbstractRepositoryMetadata.- Parameters:
repositoryInterface- must not be null and must be an interface.
-
-
Method Details
-
getMetadata
Creates a newRepositoryMetadatafor the given repository interface.- Parameters:
repositoryInterface- must not be null.- Returns:
- Since:
- 1.9
-
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:
-
getRepositoryInterface
Description copied from interface:RepositoryMetadataReturns the repository interface.- Specified by:
getRepositoryInterfacein interfaceRepositoryMetadata- Returns:
-
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:
-