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
ConstructorDescriptionAbstractRepositoryMetadata
(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.ReturnsCrudMethods
meta information for the repository.static RepositoryMetadata
getMetadata
(Class<?> repositoryInterface) Creates a newRepositoryMetadata
for 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 typeMethod
return type as it is declared in the repository.boolean
Returns whether the repository is a paging one.boolean
Returns 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, wait
Methods 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 newRepositoryMetadata
for the given repository interface.- Parameters:
repositoryInterface
- must not be null.- Returns:
- Since:
- 1.9
-
getReturnType
Description copied from interface:RepositoryMetadata
Returns the typeMethod
return 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:
getReturnType
in interfaceRepositoryMetadata
- Returns:
-
getReturnedDomainClass
Description copied from interface:RepositoryMetadata
Returns the domain class returned by the givenMethod
. In contrast toRepositoryMetadata.getReturnType(Method)
, this method extracts the type fromCollection
s andPage
as well.- Specified by:
getReturnedDomainClass
in interfaceRepositoryMetadata
- Returns:
- See Also:
-
getRepositoryInterface
Description copied from interface:RepositoryMetadata
Returns the repository interface.- Specified by:
getRepositoryInterface
in interfaceRepositoryMetadata
- Returns:
-
getCrudMethods
Description copied from interface:RepositoryMetadata
ReturnsCrudMethods
meta information for the repository.- Specified by:
getCrudMethods
in interfaceRepositoryMetadata
- Returns:
-
isPagingRepository
public boolean isPagingRepository()Description copied from interface:RepositoryMetadata
Returns whether the repository is a paging one.- Specified by:
isPagingRepository
in interfaceRepositoryMetadata
- Returns:
-
getAlternativeDomainTypes
Description copied from interface:RepositoryMetadata
Returns the set of types the repository shall be discoverable for when trying to look up a repository by domain type.- Specified by:
getAlternativeDomainTypes
in 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:RepositoryMetadata
Returns whether the repository is a reactive one, i.e. if it uses reactive types in one of its methods.- Specified by:
isReactiveRepository
in interfaceRepositoryMetadata
- Returns:
-