Record Class KeysetScrollSpecification<T>
java.lang.Object
java.lang.Record
org.springframework.data.jpa.repository.query.KeysetScrollSpecification<T>
- All Implemented Interfaces:
Serializable,Specification<T>
public record KeysetScrollSpecification<T>(org.springframework.data.domain.KeysetScrollPosition position, org.springframework.data.domain.Sort sort, JpaEntityInformation<?,?> entity)
extends Record
implements Specification<T>
Specification to create scroll queries using keyset-scrolling.- Since:
- 3.1
- Author:
- Mark Paluch, Christoph Strobl
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.data.jpa.domain.Specification
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionKeysetScrollSpecification(org.springframework.data.domain.KeysetScrollPosition position, org.springframework.data.domain.Sort sort, JpaEntityInformation<?, ?> entity) Creates an instance of aKeysetScrollSpecificationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.persistence.criteria.PredicatecreatePredicate(jakarta.persistence.criteria.Root<?> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) static org.springframework.data.domain.SortcreateSort(org.springframework.data.domain.KeysetScrollPosition position, org.springframework.data.domain.Sort sort, JpaEntityInformation<?, ?> entity) Create aSortobject to be used with the actual query.JpaEntityInformation<?,?> entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.springframework.data.domain.KeysetScrollPositionposition()Returns the value of thepositionrecord component.org.springframework.data.domain.Sortsort()Returns the value of thesortrecord component.jakarta.persistence.criteria.PredicatetoPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Creates a WHERE clause for a query of the referenced entity in form of aPredicatefor the givenRootandCriteriaQuery.final StringtoString()Returns a string representation of this record class.Methods 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
-
KeysetScrollSpecification
public KeysetScrollSpecification(org.springframework.data.domain.KeysetScrollPosition position, org.springframework.data.domain.Sort sort, JpaEntityInformation<?, ?> entity) Creates an instance of aKeysetScrollSpecificationrecord class.- Parameters:
position- the value for thepositionrecord componentsort- the value for thesortrecord componententity- the value for theentityrecord component
-
-
Method Details
-
createSort
public static org.springframework.data.domain.Sort createSort(org.springframework.data.domain.KeysetScrollPosition position, org.springframework.data.domain.Sort sort, JpaEntityInformation<?, ?> entity) Create aSortobject to be used with the actual query.- Parameters:
position- must not be null.sort- must not be null.entity- must not be null.
-
toPredicate
public jakarta.persistence.criteria.Predicate toPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Description copied from interface:SpecificationCreates a WHERE clause for a query of the referenced entity in form of aPredicatefor the givenRootandCriteriaQuery.- Specified by:
toPredicatein interfaceSpecification<T>- Parameters:
root- must not be null.query- must not be null.criteriaBuilder- must not be null.- Returns:
- a
Predicate, may be null.
-
createPredicate
@Nullable public jakarta.persistence.criteria.Predicate createPredicate(jakarta.persistence.criteria.Root<?> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
position
public org.springframework.data.domain.KeysetScrollPosition position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
sort
public org.springframework.data.domain.Sort sort()Returns the value of thesortrecord component.- Returns:
- the value of the
sortrecord component
-
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-