Class WebQueryRepositoryImpl<T>

java.lang.Object
in.co.akshitbansal.springwebquery.repository.WebQueryRepositoryImpl<T>
Type Parameters:
T - entity type backing the repository
All Implemented Interfaces:
WebQueryRepository<T>, org.springframework.data.repository.core.support.RepositoryMetadataAccess

public class WebQueryRepositoryImpl<T> extends Object implements WebQueryRepository<T>, org.springframework.data.repository.core.support.RepositoryMetadataAccess
Spring Data fragment implementation for WebQueryRepository.

This implementation resolves the current repository domain type through RepositoryMethodContext and uses the JPA Criteria API to execute tuple and count queries.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<jakarta.persistence.Tuple>
    findAll(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable, BiFunction<jakarta.persistence.criteria.Root<T>,jakarta.persistence.criteria.CriteriaBuilder,List<jakarta.persistence.criteria.Selection<?>>> selectionsProvider)
    Executes a tuple query for the given specification, sort/page request, and selection definition.
    org.springframework.data.domain.Page<jakarta.persistence.Tuple>
    findAllPaged(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable, BiFunction<jakarta.persistence.criteria.Root<T>,jakarta.persistence.criteria.CriteriaBuilder,List<jakarta.persistence.criteria.Selection<?>>> selectionsProvider)
    Executes a tuple query and wraps the results in a page.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WebQueryRepositoryImpl

      public WebQueryRepositoryImpl()
  • Method Details

    • findAll

      public List<jakarta.persistence.Tuple> findAll(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable, BiFunction<jakarta.persistence.criteria.Root<T>,jakarta.persistence.criteria.CriteriaBuilder,List<jakarta.persistence.criteria.Selection<?>>> selectionsProvider)
      Description copied from interface: WebQueryRepository
      Executes a tuple query for the given specification, sort/page request, and selection definition.
      Specified by:
      findAll in interface WebQueryRepository<T>
      Parameters:
      specification - filtering criteria to apply
      pageable - paging and sorting information; sorting is always applied and limits are applied when paged
      selectionsProvider - 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(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable, BiFunction<jakarta.persistence.criteria.Root<T>,jakarta.persistence.criteria.CriteriaBuilder,List<jakarta.persistence.criteria.Selection<?>>> selectionsProvider)
      Description copied from interface: WebQueryRepository
      Executes a tuple query and wraps the results in a page.

      When pageable is unpaged, the returned page contains all matching tuples without issuing a separate count query.

      Specified by:
      findAllPaged in interface WebQueryRepository<T>
      Parameters:
      specification - filtering criteria to apply
      pageable - paging and sorting information; sorting is always applied and limits are applied when paged
      selectionsProvider - callback that defines the tuple selections for the query
      Returns:
      a page of tuples matching the requested filter, sort, and selection set