Interface Specification<T>
- Type Parameters:
T
- The entity root type
Deprecated, for removal: This API element is subject to removal in a future version.
Specification in the sense of Domain Driven Design.
Fork from org.springframework.data.jpa.domain.Specification.
- Since:
- 3.1
- Author:
- Oliver Gierke, Thomas Darimont, Krzysztof Rzymkowski, Sebastian Staudt, Mark Paluch, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull Specification<T>
and
(@Nullable Specification<T> other) Deprecated, for removal: This API element is subject to removal in a future version.ANDs the givenSpecification
to the current one.static <T> @NonNull Specification<T>
not
(@Nullable Specification<T> spec) Deprecated, for removal: This API element is subject to removal in a future version.Negates the givenSpecification
.default @NonNull Specification<T>
or
(@Nullable Specification<T> other) Deprecated, for removal: This API element is subject to removal in a future version.ORs the given specification to the current one.@Nullable jakarta.persistence.criteria.Predicate
toPredicate
(@NonNull jakarta.persistence.criteria.Root<T> root, @NonNull jakarta.persistence.criteria.CriteriaQuery<?> query, @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Deprecated, for removal: This API element is subject to removal in a future version.Creates a WHERE clause for a query of the referenced entity in form of aPredicate
for the givenRoot
andCriteriaQuery
.static <T> @NonNull Specification<T>
where
(@Nullable Specification<T> spec) Deprecated, for removal: This API element is subject to removal in a future version.Simple static factory method to add some syntactic sugar around aSpecification
.
-
Method Details
-
not
Deprecated, for removal: This API element is subject to removal in a future version.Negates the givenSpecification
.- Type Parameters:
T
- the type of theRoot
the resulting Specification operates on.- Parameters:
spec
- can be null.- Returns:
- guaranteed to be not null.
-
where
Deprecated, for removal: This API element is subject to removal in a future version.Simple static factory method to add some syntactic sugar around aSpecification
.- Type Parameters:
T
- the type of theRoot
the resulting Specification operates on.- Parameters:
spec
- can be null.- Returns:
- guaranteed to be not null.
-
and
Deprecated, for removal: This API element is subject to removal in a future version.ANDs the givenSpecification
to the current one.- Parameters:
other
- can be null.- Returns:
- The conjunction of the specifications
-
or
Deprecated, for removal: This API element is subject to removal in a future version.ORs the given specification to the current one.- Parameters:
other
- can be null.- 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) Deprecated, for removal: This API element is subject to removal in a future version.Creates a WHERE clause for a query of the referenced entity in form of aPredicate
for the givenRoot
andCriteriaQuery
.- Parameters:
root
- must not be null.query
- must not be null.criteriaBuilder
- must not be null.- Returns:
- a
Predicate
, may be null.
-
JpaSpecificationExecutor
andQuerySpecification