Class ReturnedType

java.lang.Object
org.springframework.data.repository.query.ReturnedType

public abstract class ReturnedType extends Object
A representation of the type returned by a QueryMethod.
Since:
1.12
Author:
Oliver Gierke, Christoph Strobl, Mark Paluch
  • Method Details

    • getDomainType

      public final Class<?> getDomainType()
      Returns the entity type.
      Returns:
    • isInstance

      public final boolean isInstance(@Nullable Object source)
      Returns whether the given source object is an instance of the returned type.
      Parameters:
      source - can be null.
      Returns:
    • isProjecting

      public abstract boolean isProjecting()
      Returns whether the type is projecting, i.e. not of the domain type.
      Returns:
    • getReturnedType

      public abstract Class<?> 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

      @Nullable public abstract Class<?> 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

      public abstract List<String> getInputProperties()
      Returns the properties required to be used to populate the result.
      Returns: