Interface StoredQuery<E,​R>

    • Method Detail

      • getRootEntity

        @NonNull
        java.lang.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
        java.lang.String getQuery()
        The query to execute.
        Returns:
        The query to execute
      • getExpandableQueryParts

        @NonNull
        java.lang.String[] getExpandableQueryParts()
        The query to execute.
        Returns:
        The query to execute
      • getQueryBindings

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

        @NonNull
        java.lang.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 java.util.Optional<java.lang.Class<?>> getEntityIdentifierType()
        The type of the ID member of the entity.
        Returns:
        The ID type
      • getArgumentTypes

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

        @NonNull
        @Deprecated
        default java.util.Map<java.lang.String,​java.lang.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:
        useNumericPlaceholders()
      • 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:
        useNumericPlaceholders()
      • getParameterNames

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

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

        @NonNull
        default java.util.Map<java.lang.String,​java.lang.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 java.lang.String getLastUpdatedProperty()
        Deprecated.
        The name of the last updated property on the entity if any.
        Returns:
        The last updated property
      • getIndexedParameterAutoPopulatedPropertyPaths

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

        @Deprecated
        default java.lang.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 java.util.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