Class Between<T>
java.lang.Object
net.kaczmarzyk.spring.data.jpa.domain.PathSpecification<T>
net.kaczmarzyk.spring.data.jpa.domain.Between<T>
- All Implemented Interfaces:
Serializable,org.springframework.data.jpa.domain.Specification<T>
Filters with path between arg1 and arg2 where-clause.
Supports multiple field types: strings, numbers, booleans, enums, dates.
Field types must be Comparable (e.g, implement the Comparable interface); this is a JPA constraint.
NOTE: comparisons are dependent on the underlying database.
Comparisons of floats and doubles (especially floats) may be incorrect due to precision loss.
Comparisons of booleans may be dependent on the underlying database representation.
Comparisons of enums will be of their ordinal or string representations, depending on what you specified to JPA,
e.g., @Enumerated(EnumType.STRING), @Enumerated(EnumType.ORDINAL) or the default (@Enumerated(EnumType.ORDINAL))
- Author:
- Tomasz Kaczmarzyk, TP Diffenbach
- See Also:
-
Field Summary
Fields inherited from class net.kaczmarzyk.spring.data.jpa.domain.PathSpecification
path -
Constructor Summary
ConstructorsConstructorDescriptionBetween(QueryContext queryContext, String path, String[] args, Converter converter) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()jakarta.persistence.criteria.PredicatetoPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) toString()Methods inherited from class net.kaczmarzyk.spring.data.jpa.domain.PathSpecification
pathMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.data.jpa.domain.Specification
and, or
-
Constructor Details
-
Between
-
-
Method Details
-
toPredicate
public jakarta.persistence.criteria.Predicate toPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) -
equals
- Overrides:
equalsin classPathSpecification<T>
-
hashCode
public int hashCode()- Overrides:
hashCodein classPathSpecification<T>
-
toString
-