Class BasicStoredQuery<E,R>

java.lang.Object
io.micronaut.data.runtime.query.internal.BasicStoredQuery<E,R>
Type Parameters:
E - The entity type
R - The result type
All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Named, StoredDataOperation<R>, StoredQuery<E,R>
Direct Known Subclasses:
QueryResultStoredQuery

@Internal public class BasicStoredQuery<E,R> extends Object implements StoredQuery<E,R>
The basic implementation of StoredQuery.
Since:
3.5.0
Author:
Denis Stepanov
  • Constructor Details

  • Method Details

    • isDtoProjection

      public boolean isDtoProjection()
      Description copied from interface: StoredQuery
      Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project. Defaults to false.
      Specified by:
      isDtoProjection in interface StoredQuery<E,R>
      Returns:
      Whether the query is a DTO projection query
    • getOperationType

      public StoredQuery.OperationType getOperationType()
      Description copied from interface: StoredQuery
      Get the operation type.
      Specified by:
      getOperationType in interface StoredQuery<E,R>
      Returns:
      The operation type.
    • getAnnotationMetadata

      public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • getName

      public String getName()
      Specified by:
      getName in interface io.micronaut.core.naming.Named
    • getRootEntity

      public Class<E> getRootEntity()
      Description copied from interface: StoredQuery
      The root entity type.
      Specified by:
      getRootEntity in interface StoredQuery<E,R>
      Returns:
      The root entity type
    • getResultType

      public Class<R> getResultType()
      Description copied from interface: StoredQuery
      The query result type. This may differ from the root entity type returned by StoredQuery.getRootEntity().
      Specified by:
      getResultType in interface StoredQuery<E,R>
      Returns:
      The query result type
    • getResultArgument

      public io.micronaut.core.type.Argument<R> getResultArgument()
      Description copied from interface: StoredQuery
      The query result type. This may differ from the root entity type returned by StoredQuery.getRootEntity().
      Specified by:
      getResultArgument in interface StoredDataOperation<E>
      Specified by:
      getResultArgument in interface StoredQuery<E,R>
      Returns:
      The query result type
    • getResultDataType

      public DataType getResultDataType()
      Specified by:
      getResultDataType in interface StoredQuery<E,R>
      Returns:
      The result data type.
    • hasPageable

      public boolean hasPageable()
      Description copied from interface: StoredQuery
      Does the query have a pageable.
      Specified by:
      hasPageable in interface StoredQuery<E,R>
      Returns:
      True if it does
    • getQuery

      public String getQuery()
      Description copied from interface: StoredQuery
      The query to execute.
      Specified by:
      getQuery in interface StoredQuery<E,R>
      Returns:
      The query to execute
    • getExpandableQueryParts

      public String[] getExpandableQueryParts()
      Description copied from interface: StoredQuery
      The query to execute.
      Specified by:
      getExpandableQueryParts in interface StoredQuery<E,R>
      Returns:
      The query to execute
    • getQueryBindings

      public List<QueryParameterBinding> getQueryBindings()
      Description copied from interface: StoredQuery
      The list of query bindings.
      Specified by:
      getQueryBindings in interface StoredQuery<E,R>
      Returns:
      the query bindings
    • useNumericPlaceholders

      public boolean useNumericPlaceholders()
      Description copied from interface: StoredQuery
      Are the placeholders for query set using numeric indices starting from 1.
      Specified by:
      useNumericPlaceholders in interface StoredQuery<E,R>
      Returns:
      True if they are.
    • isCount

      public boolean isCount()
      Specified by:
      isCount in interface StoredQuery<E,R>
      Returns:
      Is this a count query.
    • isSingleResult

      public boolean isSingleResult()
      Description copied from interface: StoredQuery
      Whether the query can be treated as a single result.
      Specified by:
      isSingleResult in interface StoredQuery<E,R>
      Returns:
      True if it can.
    • hasResultConsumer

      public boolean hasResultConsumer()
      Specified by:
      hasResultConsumer in interface StoredQuery<E,R>
      Returns:
      Whether a result consumer is present
    • isRawQuery

      public boolean isRawQuery()
      Description copied from interface: StoredQuery
      Gets an indicator telling whether underlying query is raw query.
      Specified by:
      isRawQuery in interface StoredQuery<E,R>
      Returns:
      true if it is raw query