Interface QuerySpecification<T>

Type Parameters:
T - The entity root type

public interface QuerySpecification<T>
Criteria query specification. Based on Spring Data's org.springframework.data.jpa.domain.Specification.
Since:
3.2
Author:
Denis Stepanov
  • Field Details

  • Method Details

    • not

      @NonNull static <T> @NonNull QuerySpecification<T> not(@Nullable @Nullable QuerySpecification<T> spec)
      Negates the given QuerySpecification.
      Type Parameters:
      T - the type of the Root the resulting Specification operates on.
      Parameters:
      spec - The specification.
      Returns:
      negated specification}.
    • where

      @NonNull static <T> @NonNull QuerySpecification<T> where(@Nullable @Nullable QuerySpecification<T> spec)
      Simple static factory method to add some syntactic sugar around a QuerySpecification.
      Type Parameters:
      T - the type of the Root the resulting Specification operates on.
      Parameters:
      spec - The specification.
      Returns:
      guaranteed to be not null.
    • where

      @NonNull static <T> @NonNull QuerySpecification<T> where(@Nullable @Nullable PredicateSpecification<T> spec)
      Simple static factory method to add some syntactic sugar around a PredicateSpecification.
      Type Parameters:
      T - the type of the Root the resulting Specification operates on.
      Parameters:
      spec - The specification.
      Returns:
      query specification.
    • and

      @NonNull default @NonNull QuerySpecification<T> and(@Nullable @Nullable QuerySpecification<T> other)
      ANDs the given QuerySpecification to the current one.
      Parameters:
      other - The other predicate.
      Returns:
      The conjunction of the specifications
    • or

      @NonNull default @NonNull QuerySpecification<T> or(@Nullable @Nullable QuerySpecification<T> other)
      ORs the given specification to the current one.
      Parameters:
      other - The other predicate.
      Returns:
      The disjunction of the specifications
    • and

      @NonNull default @NonNull QuerySpecification<T> and(@Nullable @Nullable PredicateSpecification<T> other)
      ANDs the given PredicateSpecification to the current one.
      Parameters:
      other - The other predicate.
      Returns:
      The conjunction of the specifications
    • or

      @NonNull default @NonNull QuerySpecification<T> or(@Nullable @Nullable PredicateSpecification<T> other)
      ORs the given PredicateSpecification to the current one.
      Parameters:
      other - The other predicate.
      Returns:
      The disjunction of the specifications
    • toPredicate

      @Nullable @Nullable jakarta.persistence.criteria.Predicate toPredicate(@NonNull @NonNull jakarta.persistence.criteria.Root<T> root, @NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<?> query, @NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
      Creates a WHERE clause predicate for the given entity Root and a criteria query.
      Parameters:
      root - The entity root
      query - The criteria query
      criteriaBuilder - The criteria builder
      Returns:
      a Predicate