Class 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 java.lang.Object
    implements StoredQuery<E,​R>
    The basic implementation of StoredQuery.
    Since:
    3.5.0
    Author:
    Denis Stepanov
    • Constructor Detail

      • BasicStoredQuery

        public BasicStoredQuery​(java.lang.String query,
                                java.lang.String[] expandableQueryParts,
                                java.util.List<QueryParameterBinding> queryParameterBindings,
                                java.lang.Class<E> rootEntity,
                                java.lang.Class<R> resultType)
      • BasicStoredQuery

        public BasicStoredQuery​(java.lang.String name,
                                io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
                                java.lang.String query,
                                java.lang.String[] expandableQueryParts,
                                java.util.List<QueryParameterBinding> queryParameterBindings,
                                java.lang.Class<E> rootEntity,
                                java.lang.Class<R> resultType,
                                boolean pageable,
                                boolean isSingleResult,
                                boolean isCount)
    • Method Detail

      • getAnnotationMetadata

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

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

        public java.lang.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
      • 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 java.lang.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 java.lang.String[] getExpandableQueryParts()
        Description copied from interface: StoredQuery
        The query to execute.
        Specified by:
        getExpandableQueryParts in interface StoredQuery<E,​R>
        Returns:
        The query to execute
      • 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