Class ReturnedType
java.lang.Object
org.springframework.data.repository.query.ReturnedType
A representation of the type returned by a
QueryMethod.- Since:
- 1.12
- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Class<?> Returns the entity type.Returns the properties required to be used to populate the result.abstract Class<?> Returns the type of the individual objects to return.abstract @Nullable Class<?> Returns the type that the query execution is supposed to pass to the underlying infrastructure.booleanReturns whether the returned type has input properties.final booleanisInstance(@Nullable Object source) Returns whether the given source object is an instance of the returned type.abstract booleanReturns whether the type is projecting, i.e. not of the domain type.abstract booleanReturns whether the returned type will require custom construction.static ReturnedTypeof(Class<?> returnedType, Class<?> domainType, ProjectionFactory factory) Creates a newReturnedTypefor the given returned type, domain type andProjectionFactory.
-
Constructor Details
-
ReturnedType
-
-
Method Details
-
of
public static ReturnedType of(Class<?> returnedType, Class<?> domainType, ProjectionFactory factory) Creates a newReturnedTypefor the given returned type, domain type andProjectionFactory.- Parameters:
returnedType- return type for the query result, must not be null.domainType- domain type for the query context, must not be null.factory- must not be null.- Returns:
- the ReturnedType for the given returned type, domain type and
ProjectionFactory. - Since:
- 3.3.5
-
getDomainType
-
isInstance
-
isProjecting
public abstract boolean isProjecting()Returns whether the type is projecting, i.e. not of the domain type.- Returns:
-
getReturnedType
Returns the type of the individual objects to return.- Returns:
-
needsCustomConstruction
public abstract boolean needsCustomConstruction()Returns whether the returned type will require custom construction.- Returns:
-
getTypeToRead
Returns the type that the query execution is supposed to pass to the underlying infrastructure. null is returned to indicate a generic type (a map or tuple-like type) shall be used.- Returns:
-
getInputProperties
-
hasInputProperties
public boolean hasInputProperties()Returns whether the returned type has input properties.- Returns:
- Since:
- 3.3.5
- See Also:
-