Class DefaultStoredQueryResolver

java.lang.Object
io.micronaut.data.runtime.query.DefaultStoredQueryResolver
All Implemented Interfaces:
StoredQueryResolver

@Internal public abstract class DefaultStoredQueryResolver extends Object implements StoredQueryResolver
Default stored query resolver.
Since:
3.3
Author:
Denis Stepanov
  • Constructor Details

    • DefaultStoredQueryResolver

      public DefaultStoredQueryResolver()
  • Method Details

    • resolveQuery

      public <E, R> StoredQuery<E,R> resolveQuery(io.micronaut.aop.MethodInvocationContext<?,?> context, Class<E> entityClass, Class<R> resultType, boolean isCount)
      Description copied from interface: StoredQueryResolver
      Stored query resolved from the method context.
      Specified by:
      resolveQuery in interface StoredQueryResolver
      Type Parameters:
      E - The entity type
      R - The result type
      Parameters:
      context - The method context
      entityClass - The entity type
      resultType - The result type
      isCount - Whether query is count query
      Returns:
      The prepared query
    • resolveCountQuery

      public <E, R> StoredQuery<E,R> resolveCountQuery(io.micronaut.aop.MethodInvocationContext<?,?> context, Class<E> entityClass, Class<R> resultType)
      Description copied from interface: StoredQueryResolver
      Stored count query resolved from the method context.
      Specified by:
      resolveCountQuery in interface StoredQueryResolver
      Type Parameters:
      E - The entity type
      R - The result type
      Parameters:
      context - The method context
      entityClass - The entity type
      resultType - The result type
      Returns:
      The prepared query
    • createStoredQuery

      public <E, QR> StoredQuery<E,QR> createStoredQuery(io.micronaut.inject.ExecutableMethod<?,?> executableMethod, StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Class<Object> rootEntity, String query, String update, String[] queryParts, List<QueryParameterBinding> queryParameters, boolean pageable, boolean isSingleResult)
      Description copied from interface: StoredQueryResolver
      Create stored query from provided values. Used for criteria stored query creation.
      Specified by:
      createStoredQuery in interface StoredQueryResolver
      Type Parameters:
      E - The entity type
      QR - The result type
      Parameters:
      executableMethod - The executableMethod
      operationType - The operationType
      name - The name
      annotationMetadata - The annotation metadata
      rootEntity - The root entity
      query - The query
      update - The update query
      queryParts - The query parts
      queryParameters - The query parameters
      pageable - Has pageable
      isSingleResult - Is single result
      Returns:
      new instance of stored query
    • createCountStoredQuery

      public StoredQuery<Object,Long> createCountStoredQuery(io.micronaut.inject.ExecutableMethod<?,?> executableMethod, StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Class<Object> rootEntity, String query, String[] queryParts, List<QueryParameterBinding> queryParameters)
      Description copied from interface: StoredQueryResolver
      Create count stored query from provided values. Used for criteria stored query creation.
      Specified by:
      createCountStoredQuery in interface StoredQueryResolver
      Parameters:
      executableMethod - The executableMethod
      operationType - The operationType
      name - The name
      annotationMetadata - The annotation metadata
      rootEntity - The root entity
      query - The query
      queryParts - The query parts
      queryParameters - The query parameters
      Returns:
      new instance of stored query
    • getHintsCapableRepository

      protected abstract HintsCapableRepository getHintsCapableRepository()