Class EntitySpecifications

java.lang.Object
com.bluebell.greenhouse.radicle.specifications.EntitySpecifications

public final class EntitySpecifications extends Object
Common Specification builders for entity search filters.
Version:
2.0.3
Author:
Stephen Prizio
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T,V> org.springframework.data.jpa.domain.Specification<T>
    equalToIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
    Builds an equality filter when the value is present.
    static <T, V extends Comparable<? super V>>
    org.springframework.data.jpa.domain.Specification<T>
    greaterThanOrEqualToIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
    Builds a greater-than-or-equal-to filter when the value is present.
    static <T> org.springframework.data.jpa.domain.Specification<T>
    isNullIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<?>> pathResolver, Boolean isNull)
    Builds a null-state filter when the requested null state is present.
    static <T, V extends Comparable<? super V>>
    org.springframework.data.jpa.domain.Specification<T>
    lessThanIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
    Builds a less-than filter when the value is present.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equalToIfPresent

      public static <T,V> org.springframework.data.jpa.domain.Specification<T> equalToIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
      Builds an equality filter when the value is present.
      Type Parameters:
      T - entity type
      V - value type
      Parameters:
      pathResolver - path resolver
      value - comparison value
      Returns:
      Specification
    • greaterThanOrEqualToIfPresent

      public static <T, V extends Comparable<? super V>> org.springframework.data.jpa.domain.Specification<T> greaterThanOrEqualToIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
      Builds a greater-than-or-equal-to filter when the value is present.
      Type Parameters:
      T - entity type
      V - value type
      Parameters:
      pathResolver - path resolver
      value - comparison value
      Returns:
      Specification
    • lessThanIfPresent

      public static <T, V extends Comparable<? super V>> org.springframework.data.jpa.domain.Specification<T> lessThanIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<V>> pathResolver, V value)
      Builds a less-than filter when the value is present.
      Type Parameters:
      T - entity type
      V - value type
      Parameters:
      pathResolver - path resolver
      value - comparison value
      Returns:
      Specification
    • isNullIfPresent

      public static <T> org.springframework.data.jpa.domain.Specification<T> isNullIfPresent(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Expression<?>> pathResolver, Boolean isNull)
      Builds a null-state filter when the requested null state is present.
      Type Parameters:
      T - entity type
      Parameters:
      pathResolver - path resolver
      isNull - true for null values, false for non-null values, null for no filter
      Returns:
      Specification