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<?>Return the entity type.Return the properties required to be used to populate the result.abstract Class<?>Return the type of the individual objects to return.abstract Class<?>Return the type that the query execution is supposed to pass to the underlying infrastructure.booleanReturn whether the returned type has input properties.booleanReturn whether the type is a DTO projection.final booleanisInstance(Object source) Return whether the given source object is an instance of the returned type.booleanReturn whether the type is an interface-projection.abstract booleanReturn whether the type is projecting, i.e. not of the domain type.abstract booleanReturn 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
Return the entity type.- Returns:
-
isInstance
Return whether the given source object is an instance of the returned type.- Parameters:
source- can be null.- Returns:
-
getReturnedType
Return the type of the individual objects to return.- Returns:
-
isProjecting
public abstract boolean isProjecting()Return whether the type is projecting, i.e. not of the domain type.- Returns:
-
isInterfaceProjection
public boolean isInterfaceProjection()Return whether the type is an interface-projection.- Since:
- 3.5.7
-
isDtoProjection
public boolean isDtoProjection()Return whether the type is a DTO projection.- Since:
- 3.5.7
-
getInputProperties
Return the properties required to be used to populate the result. -
hasInputProperties
public boolean hasInputProperties()Return whether the returned type has input properties.- Since:
- 3.3.5
- See Also:
-
needsCustomConstruction
public abstract boolean needsCustomConstruction()Return whether the returned type will require custom construction. -
getTypeToRead
Return 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.
-