Class AbstractSpecificationInterceptor<T,R>

java.lang.Object
io.micronaut.data.runtime.intercept.AbstractQueryInterceptor<T,R>
io.micronaut.data.runtime.intercept.criteria.AbstractSpecificationInterceptor<T,R>
Type Parameters:
T - The declaring type
R - The return type
All Implemented Interfaces:
DataInterceptor<T,R>
Direct Known Subclasses:
AbstractAsyncSpecificationInterceptor, AbstractReactiveSpecificationInterceptor, CountSpecificationInterceptor, DeleteAllSpecificationInterceptor, ExistsSpecificationInterceptor, FindAllSpecificationInterceptor, FindOneSpecificationInterceptor, FindPageSpecificationInterceptor, UpdateAllSpecificationInterceptor

@Internal public abstract class AbstractSpecificationInterceptor<T,R> extends AbstractQueryInterceptor<T,R>
Abstract specification interceptor.
Since:
3.2
Author:
Denis Stepanov
  • Field Details

  • Constructor Details

    • AbstractSpecificationInterceptor

      protected AbstractSpecificationInterceptor(RepositoryOperations operations)
      Default constructor.
      Parameters:
      operations - The operations
  • Method Details

    • findAll

      @NonNull protected final @NonNull Iterable<?> findAll(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context, AbstractSpecificationInterceptor.Type type)
    • findOne

      @NonNull protected final @NonNull Object findOne(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context, AbstractSpecificationInterceptor.Type type)
    • getMethodJoinPaths

      protected final Set<JoinPath> getMethodJoinPaths(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context)
    • count

      @NonNull protected final @NonNull Long count(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context)
    • exists

      protected final boolean exists(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context)
    • deleteAll

      protected final Optional<Number> deleteAll(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context)
    • updateAll

      protected final Optional<Number> updateAll(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context)
    • preparedQueryForCriteria

      @NonNull protected final <E, QR> @NonNull PreparedQuery<E,QR> preparedQueryForCriteria(RepositoryMethodKey methodKey, io.micronaut.aop.MethodInvocationContext<T,R> context, AbstractSpecificationInterceptor.Type type, Set<JoinPath> methodJoinPaths)
    • buildExistsQuery

      protected final <E> jakarta.persistence.criteria.CriteriaQuery<E> buildExistsQuery(io.micronaut.aop.MethodInvocationContext<T,R> context, Set<JoinPath> annotationJoinPaths)
    • buildUpdateQuery

      protected final <E> jakarta.persistence.criteria.CriteriaUpdate<E> buildUpdateQuery(io.micronaut.aop.MethodInvocationContext<T,R> context)
    • buildDeleteQuery

      protected final <E> jakarta.persistence.criteria.CriteriaDelete<E> buildDeleteQuery(io.micronaut.aop.MethodInvocationContext<T,R> context)
    • buildCountQuery

      @NonNull protected final <E> @NonNull jakarta.persistence.criteria.CriteriaQuery<Long> buildCountQuery(io.micronaut.aop.MethodInvocationContext<T,R> context)
    • buildQuery

      protected final <N> jakarta.persistence.criteria.CriteriaQuery<N> buildQuery(io.micronaut.aop.MethodInvocationContext<T,R> context, AbstractSpecificationInterceptor.Type type, Set<JoinPath> methodJoinPaths)
    • getQuerySpecification

      @Nullable protected <K> @Nullable QuerySpecification<K> getQuerySpecification(io.micronaut.aop.MethodInvocationContext<?,?> context)
      Find QuerySpecification in context.
      Type Parameters:
      K - the specification entity root type
      Parameters:
      context - The context
      Returns:
      found specification
    • getCriteriaQueryBuilder

      @NonNull protected <K> @NonNull CriteriaQueryBuilder<K> getCriteriaQueryBuilder(io.micronaut.aop.MethodInvocationContext<?,?> context, Set<JoinPath> joinPaths)
      Type Parameters:
      K - the result type
      Parameters:
      context - The context
      joinPaths - The join fetch paths
      Returns:
      found specification
    • getDeleteSpecification

      @Nullable protected <K> @Nullable DeleteSpecification<K> getDeleteSpecification(io.micronaut.aop.MethodInvocationContext<?,?> context)
      Find DeleteSpecification in context.
      Type Parameters:
      K - the specification entity root type
      Parameters:
      context - The context
      Returns:
      found specification
    • getCriteriaDeleteBuilder

      @NonNull protected <K> @NonNull CriteriaDeleteBuilder<K> getCriteriaDeleteBuilder(io.micronaut.aop.MethodInvocationContext<?,?> context)
      Type Parameters:
      K - the result type
      Parameters:
      context - The context
      Returns:
      found specification
    • getUpdateSpecification

      @Nullable protected <K> @Nullable UpdateSpecification<K> getUpdateSpecification(io.micronaut.aop.MethodInvocationContext<?,?> context)
      Find UpdateSpecification in context.
      Type Parameters:
      K - the specification entity root type
      Parameters:
      context - The context
      Returns:
      found specification
    • getCriteriaUpdateBuilder

      @NonNull protected <K> @NonNull CriteriaUpdateBuilder<K> getCriteriaUpdateBuilder(io.micronaut.aop.MethodInvocationContext<?,?> context)
      Type Parameters:
      K - the result type
      Parameters:
      context - The context
      Returns:
      found specification