Interface StoredQuery<E,R>

Type Parameters:
E - The entity type
R - The result type
All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Named, StoredDataOperation<R>
All Known Subinterfaces:
BindableParametersPreparedQuery<E,R>, BindableParametersStoredQuery<E,R>, DelegatePreparedQuery<E,R>, DelegateStoredQuery<E,R>, MongoPreparedQuery<E,R>, MongoStoredQuery<E,R>, PreparedQuery<E,R>, SqlPreparedQuery<E,R>, SqlStoredQuery<E,R>
All Known Implementing Classes:
BasicStoredQuery, DefaultBindableParametersPreparedQuery, DefaultBindableParametersStoredQuery, DefaultPreparedQuery, DefaultSqlPreparedQuery, DefaultSqlStoredQuery, DefaultStoredQuery, DummyPreparedQuery, QueryResultStoredQuery

public interface StoredQuery<E,R> extends io.micronaut.core.naming.Named, StoredDataOperation<R>
A stored computed query. This interface represents the
Since:
1.0.0
Author:
graemerocher
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Describes the operation type.
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    The query to execute.
    default Set<JoinPath>
     
    Get the operation type.
    default Map<String,io.micronaut.core.annotation.AnnotationValue<?>>
    Parameter expressions.
    The query to execute.
    The list of query bindings.
    default Map<String,Object>
    The parameter binding.
    default Limit
     
    io.micronaut.core.type.Argument<R>
    The query result type.
     
    The query result type.
    The root entity type.
    default Sort
     
    boolean
    Does the query have a pageable.
    boolean
     
    boolean
     
    default boolean
    Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project.
    default boolean
     
    default boolean
    In cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).
    default boolean
    Is with an optimistic lock.
    default boolean
    Is the query a procedure.
    boolean
    Gets an indicator telling whether underlying query is raw query.

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

    getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared

    Methods inherited from interface io.micronaut.core.naming.Named

    getName
  • Method Details

    • getRootEntity

      Class<E> getRootEntity()
      The root entity type.
      Returns:
      The root entity type
    • hasPageable

      boolean hasPageable()
      Does the query have a pageable.
      Returns:
      True if it does
    • getQuery

      String getQuery()
      The query to execute.
      Returns:
      The query to execute
    • getExpandableQueryParts

      String[] getExpandableQueryParts()
      The query to execute.
      Returns:
      The query to execute
    • getQueryBindings

      List<QueryParameterBinding> getQueryBindings()
      The list of query bindings.
      Returns:
      the query bindings
    • getResultType

      Class<R> getResultType()
      The query result type. This may differ from the root entity type returned by getRootEntity().
      Returns:
      The query result type
    • getResultArgument

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

      DataType getResultDataType()
      Returns:
      The result data type.
    • isNative

      default boolean isNative()
      In cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).
      Returns:
      Whether the query is native.
    • isProcedure

      default boolean isProcedure()
      Is the query a procedure.
      Returns:
      Whether the query is a procedure invocation.
      Since:
      4.2.0
    • getOperationType

      StoredQuery.OperationType getOperationType()
      Get the operation type.
      Returns:
      The operation type.
      Since:
      4.2.0
    • isDtoProjection

      default boolean isDtoProjection()
      Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project. Defaults to false.
      Returns:
      Whether the query is a DTO projection query
    • isCount

      boolean isCount()
      Returns:
      Is this a count query.
    • getQueryHints

      default Map<String,Object> getQueryHints()
      The parameter binding. That is the mapping between named query parameters and parameters of the method.
      Returns:
      The parameter binding.
    • getJoinPaths

      default Set<JoinPath> getJoinPaths()
      Returns:
      The all join paths
      Since:
      4.8.1
    • hasResultConsumer

      boolean hasResultConsumer()
      Returns:
      Whether a result consumer is present
    • isOptimisticLock

      default boolean isOptimisticLock()
      Is with an optimistic lock.
      Returns:
      the result
    • isRawQuery

      boolean isRawQuery()
      Gets an indicator telling whether underlying query is raw query.
      Returns:
      true if it is raw query
    • isJsonEntity

      default boolean isJsonEntity()
      Returns:
      an indicator telling whether query is handling entities with JSON representation (like Oracle Json View)
      Since:
      4.0.0
    • getParameterExpressions

      default Map<String,io.micronaut.core.annotation.AnnotationValue<?>> getParameterExpressions()
      Parameter expressions.
      Returns:
      Parameter expressions.
      Since:
      4.5.0
    • getQueryLimit

      default Limit getQueryLimit()
      Returns:
      The query limit
      Since:
      4.13
    • getSort

      default Sort getSort()
      Returns:
      The runtime sort
      Since:
      4.13