Class WebQueryRepositoryImpl<T>
- Type Parameters:
T- entity type backing the repository
- All Implemented Interfaces:
WebQueryRepository<T>,org.springframework.data.repository.core.support.RepositoryMetadataAccess
WebQueryRepository.
This implementation resolves the current repository domain type through
RepositoryMethodContext and uses the JPA Criteria API to execute tuple and count queries. Paged execution
derives totals from a separate count query built from the Specification, so row-cardinality changes applied
through SelectionsProvider only affect the result query.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<jakarta.persistence.Tuple>findAll(@NonNull org.springframework.data.jpa.domain.Specification<T> specification, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull SelectionsProvider<T> selectionsProvider) Executes a tuple query for the given specification, sort/page request, and selection definition.org.springframework.data.domain.Page<jakarta.persistence.Tuple>findAllPaged(@NonNull org.springframework.data.jpa.domain.Specification<T> specification, @NonNull org.springframework.data.domain.Pageable pageable, @NonNull SelectionsProvider<T> selectionsProvider) Executes a tuple query and wraps the results in a page.
-
Constructor Details
-
WebQueryRepositoryImpl
public WebQueryRepositoryImpl()
-
-
Method Details
-
findAll
public List<jakarta.persistence.Tuple> findAll(@NonNull @NonNull org.springframework.data.jpa.domain.Specification<T> specification, @NonNull @NonNull org.springframework.data.domain.Pageable pageable, @NonNull @NonNull SelectionsProvider<T> selectionsProvider) Description copied from interface:WebQueryRepositoryExecutes a tuple query for the given specification, sort/page request, and selection definition.The selection callback receives the live result
CriteriaQueryso it can build correlated subqueries or inspect query state while defining projected columns.- Specified by:
findAllin interfaceWebQueryRepository<T>- Parameters:
specification- filtering criteria to applypageable- paging and sorting information; sorting is always applied and limits are applied when pagedselectionsProvider- callback that defines the tuple selections for the query- Returns:
- tuples matching the requested filter, sort, and selection set
-
findAllPaged
public org.springframework.data.domain.Page<jakarta.persistence.Tuple> findAllPaged(@NonNull @NonNull org.springframework.data.jpa.domain.Specification<T> specification, @NonNull @NonNull org.springframework.data.domain.Pageable pageable, @NonNull @NonNull SelectionsProvider<T> selectionsProvider) Description copied from interface:WebQueryRepositoryExecutes a tuple query and wraps the results in a page.When
pageableis unpaged, the returned page contains all matching tuples without issuing a separate count query.The selection callback receives the live result
CriteriaQuery. For paged execution, avoid mutating the outer query in ways that change row cardinality, such as enabling distinct results or adding grouping, because the total count is derived from a separate count query built from theSpecification.- Specified by:
findAllPagedin interfaceWebQueryRepository<T>- Parameters:
specification- filtering criteria to applypageable- paging and sorting information; sorting is always applied and limits are applied when pagedselectionsProvider- callback that defines the tuple selections for the query- Returns:
- a page of tuples matching the requested filter, sort, and selection set
-