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
    default @NonNull Class<?>[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Not used anymore
    default Optional<Class<?>>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Not used anymore
    @NonNull String[]
    The query to execute.
    default @NonNull Set<JoinPath>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use getJoinPaths() and filter the paths
    default @NonNull Set<JoinPath>
     
    default int
     
    default int
     
    Get the operation type.
    default Map<String,io.micronaut.core.annotation.AnnotationValue<?>>
    Parameter expressions.
    @NonNull String
    The query to execute.
    The list of query bindings.
    default @NonNull Map<String,Object>
    The parameter binding.
    @NonNull io.micronaut.core.type.Argument<R>
    The query result type.
    @NonNull DataType
     
    @NonNull Class<R>
    The query result type.
    @NonNull Class<E>
    The root entity type.
    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.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Not used anymore
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Not used anymore

    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

      @NonNull @NonNull 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

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

      @NonNull @NonNull 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

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

      @NonNull @NonNull 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

      @NonNull @NonNull 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
    • useNumericPlaceholders

      @Deprecated(forRemoval=true) boolean useNumericPlaceholders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore
      Are the placeholders for query set using numeric indices starting from 1.
      Returns:
      True if they are.
    • 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
    • getEntityIdentifierType

      @Deprecated(forRemoval=true) default Optional<Class<?>> getEntityIdentifierType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore
      The type of the ID member of the entity.
      Returns:
      The ID type
    • getArgumentTypes

      @Deprecated(forRemoval=true) @NonNull default @NonNull Class<?>[] getArgumentTypes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore
      The argument types to the method that invokes the query.
      Returns:
      The argument types
    • isCount

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

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

      @Deprecated(forRemoval=true, since="4.8.1") @NonNull default @NonNull Set<JoinPath> getJoinFetchPaths()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getJoinPaths() and filter the paths
      Returns:
      The join paths that require a fetch
    • getJoinPaths

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

      @Deprecated(forRemoval=true) boolean isSingleResult()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore
      Whether the query can be treated as a single result.
      Returns:
      True if it can.
    • 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
    • getLimit

      default int getLimit()
      Returns:
      The limit of the query or -1 if none
      Since:
      4.10
    • getOffset

      default int getOffset()
      Returns:
      The offset of the query or 0 if none
      Since:
      4.10