Uses of Interface
org.springframework.data.jpa.domain.Specification
Package
Description
JPA specific support classes to implement domain classes.
Interfaces and annotations for JPA specific repositories.
Query implementation to execute queries against JPA.
JPA repository implementations.
-
Uses of Specification in org.springframework.data.jpa.domain
Modifier and TypeMethodDescriptionstatic <T> Specification<T>
Specification.allOf
(Iterable<Specification<T>> specifications) Applies an AND operation to all the givenSpecification
s.static <T> Specification<T>
Specification.allOf
(Specification<T>... specifications) default Specification<T>
Specification.and
(Specification<T> other) ANDs the givenSpecification
to the current one.static <T> Specification<T>
Specification.anyOf
(Iterable<Specification<T>> specifications) Applies an OR operation to all the givenSpecification
s.static <T> Specification<T>
Specification.anyOf
(Specification<T>... specifications) static <T> Specification<T>
Specification.not
(Specification<T> spec) Negates the givenSpecification
.default Specification<T>
Specification.or
(Specification<T> other) ORs the given specification to the current one.static <T> Specification<T>
Specification.where
(Specification<T> spec) Simple static factory method to add some syntactic sugar around aSpecification
.Modifier and TypeMethodDescriptionstatic <T> Specification<T>
Specification.allOf
(Specification<T>... specifications) default Specification<T>
Specification.and
(Specification<T> other) ANDs the givenSpecification
to the current one.static <T> Specification<T>
Specification.anyOf
(Specification<T>... specifications) static <T> Specification<T>
Specification.not
(Specification<T> spec) Negates the givenSpecification
.default Specification<T>
Specification.or
(Specification<T> other) ORs the given specification to the current one.static <T> Specification<T>
Specification.where
(Specification<T> spec) Simple static factory method to add some syntactic sugar around aSpecification
.Modifier and TypeMethodDescriptionstatic <T> Specification<T>
Specification.allOf
(Iterable<Specification<T>> specifications) Applies an AND operation to all the givenSpecification
s.static <T> Specification<T>
Specification.anyOf
(Iterable<Specification<T>> specifications) Applies an OR operation to all the givenSpecification
s. -
Uses of Specification in org.springframework.data.jpa.repository
Modifier and TypeMethodDescriptionlong
JpaSpecificationExecutor.count
(Specification<T> spec) Returns the number of instances that the givenSpecification
will return.long
JpaSpecificationExecutor.delete
(Specification<T> spec) Deletes by theSpecification
and returns the number of rows deleted.boolean
JpaSpecificationExecutor.exists
(Specification<T> spec) Checks whether the data store contains elements that match the givenSpecification
.JpaSpecificationExecutor.findAll
(Specification<T> spec) Returns all entities matching the givenSpecification
.org.springframework.data.domain.Page<T>
JpaSpecificationExecutor.findAll
(Specification<T> spec, org.springframework.data.domain.Pageable pageable) Returns aPage
of entities matching the givenSpecification
.JpaSpecificationExecutor.findAll
(Specification<T> spec, org.springframework.data.domain.Sort sort) Returns all entities matching the givenSpecification
andSort
.<S extends T,
R>
RJpaSpecificationExecutor.findBy
(Specification<T> spec, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) Returns entities matching the givenSpecification
applying thequeryFunction
that defines the query and its result type.JpaSpecificationExecutor.findOne
(Specification<T> spec) Returns a single entity matching the givenSpecification
orOptional.empty()
if none found. -
Uses of Specification in org.springframework.data.jpa.repository.query
Modifier and TypeClassDescriptionfinal record
Specification
to create scroll queries using keyset-scrolling. -
Uses of Specification in org.springframework.data.jpa.repository.support
Modifier and TypeMethodDescriptionlong
SimpleJpaRepository.count
(Specification<T> spec) long
SimpleJpaRepository.delete
(Specification<T> spec) boolean
SimpleJpaRepository.exists
(Specification<T> spec) SimpleJpaRepository.findAll
(Specification<T> spec) org.springframework.data.domain.Page<T>
SimpleJpaRepository.findAll
(Specification<T> spec, org.springframework.data.domain.Pageable pageable) SimpleJpaRepository.findAll
(Specification<T> spec, org.springframework.data.domain.Sort sort) <S extends T,
R>
RSimpleJpaRepository.findBy
(Specification<T> spec, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) SimpleJpaRepository.findOne
(Specification<T> spec) SimpleJpaRepository.getCountQuery
(Specification<S> spec, Class<S> domainClass) Creates a new count query for the givenSpecification
.protected jakarta.persistence.TypedQuery<Long>
SimpleJpaRepository.getCountQuery
(Specification<T> spec) Deprecated.protected <S extends T>
jakarta.persistence.TypedQuery<S>SimpleJpaRepository.getQuery
(Specification<S> spec, Class<S> domainClass, org.springframework.data.domain.Pageable pageable) Creates a newTypedQuery
from the givenSpecification
.protected <S extends T>
jakarta.persistence.TypedQuery<S>SimpleJpaRepository.getQuery
(Specification<S> spec, Class<S> domainClass, org.springframework.data.domain.Sort sort) protected jakarta.persistence.TypedQuery<T>
SimpleJpaRepository.getQuery
(Specification<T> spec, org.springframework.data.domain.Pageable pageable) Creates a newTypedQuery
from the givenSpecification
.protected jakarta.persistence.TypedQuery<T>
SimpleJpaRepository.getQuery
(Specification<T> spec, org.springframework.data.domain.Sort sort) protected <S extends T>
org.springframework.data.domain.Page<S>SimpleJpaRepository.readPage
(jakarta.persistence.TypedQuery<S> query, Class<S> domainClass, org.springframework.data.domain.Pageable pageable, Specification<S> spec) protected org.springframework.data.domain.Page<T>
SimpleJpaRepository.readPage
(jakarta.persistence.TypedQuery<T> query, org.springframework.data.domain.Pageable pageable, Specification<T> spec) Deprecated.
SimpleJpaRepository.getCountQuery(Specification, Class)
instead