Class EntitySpecifications
java.lang.Object
com.bluebell.greenhouse.radicle.specifications.EntitySpecifications
Common
Specification builders for entity search filters.- Version:
- 2.0.3
- Author:
- Stephen Prizio
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
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 typeV- value type- Parameters:
pathResolver- path resolvervalue- 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 typeV- value type- Parameters:
pathResolver- path resolvervalue- 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 typeV- value type- Parameters:
pathResolver- path resolvervalue- 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 resolverisNull- true for null values, false for non-null values, null for no filter- Returns:
Specification
-