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
  • Method Details

    • getRootEntity

      @NonNull Class<E> getRootEntity()
      The root entity type.
      Returns:
      The root entity type
    • hasInExpression

      @Deprecated default boolean hasInExpression()
      Deprecated.
      Does the query contain an in expression.
      Returns:
      True if it does
    • hasPageable

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

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

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

      boolean useNumericPlaceholders()
      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

      default Optional<Class<?>> getEntityIdentifierType()
      The type of the ID member of the entity.
      Returns:
      The ID type
    • getArgumentTypes

      @NonNull default Class<?>[] getArgumentTypes()
      The argument types to the method that invokes the query.
      Returns:
      The argument types
    • getParameterBinding

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

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

      @Deprecated @NonNull default DataType[] getIndexedParameterTypes()
      Deprecated.
      The compute time computed parameter data types for the query indices.
      Returns:
      The indexed values
      See Also:
    • getIndexedParameterBinding

      @NonNull @Deprecated default int[] getIndexedParameterBinding()
      Deprecated.
      The parameter binding. That is the mapping between named query parameters and parameters of the method.
      Returns:
      The parameter binding.
      See Also:
    • getParameterNames

      @Deprecated default String[] getParameterNames()
      Deprecated.
      Returns:
      The parameter names the case where named parameters are supported
    • getIndexedParameterPaths

      @Deprecated default String[] getIndexedParameterPaths()
      Deprecated.
      Returns:
      The indexed parameter paths.
    • getQueryHints

      @NonNull 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.
    • getLastUpdatedProperty

      @Deprecated @Nullable default String getLastUpdatedProperty()
      Deprecated.
      The name of the last updated property on the entity if any.
      Returns:
      The last updated property
    • getIndexedParameterAutoPopulatedPropertyPaths

      @Deprecated default String[] getIndexedParameterAutoPopulatedPropertyPaths()
      Deprecated.
      The mapping between query parameters and auto populated properties that the parameter represents.
      Returns:
      The auto populated properties.
    • getIndexedParameterAutoPopulatedPreviousPropertyPaths

      @Deprecated default String[] getIndexedParameterAutoPopulatedPreviousPropertyPaths()
      Deprecated.
      The mapping between query parameters and auto populated previous properties that the parameter represents.
      Returns:
      The auto populated properties.
    • getIndexedParameterAutoPopulatedPreviousPropertyIndexes

      @Deprecated default int[] getIndexedParameterAutoPopulatedPreviousPropertyIndexes()
      Deprecated.
      The mapping between query parameters and auto populated previous properties that the parameter represents.
      Returns:
      The auto populated properties.
    • getJoinFetchPaths

      @NonNull default Set<JoinPath> getJoinFetchPaths()
      Returns:
      The join paths that require a fetch
    • isSingleResult

      boolean isSingleResult()
      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