Package com.totvs.tjf.api.jpa.repository
Interface JpaSpecificationExecutorWithProjection<T>
- All Superinterfaces:
org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>
,JpaSpecificationProjectionExecutor<T>
@NoRepositoryBean
@Deprecated(since="3.0.0-RELEASE",
forRemoval=true)
public interface JpaSpecificationExecutorWithProjection<T>
extends org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>, JpaSpecificationProjectionExecutor<T>
Deprecated, for removal: This API element is subject to removal in a future version.
- Author:
- Thiago A. de Souza Weber
-
Method Summary
Modifier and TypeMethodDescriptiondefault <P> List<P>
findAllProjected
(org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, org.springframework.data.domain.Pageable pageable) Deprecated, for removal: This API element is subject to removal in a future version.Returns all entities matching the givenSpecification
.default <P> Optional<P>
findOneProjected
(org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass) Deprecated, for removal: This API element is subject to removal in a future version.default <P> Optional<P>
findOneProjected
(org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, com.totvs.tjf.api.context.request.ApiFieldRequest fieldRequest) Deprecated, for removal: This API element is subject to removal in a future version.Returns a single entity matching the givenSpecification
orOptional.empty()
if none found.default <P> org.springframework.data.domain.Page<P>
findPageProjected
(org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, org.springframework.data.domain.Pageable pageable) Deprecated, for removal: This API element is subject to removal in a future version.Returns aPage
of entities matching the givenSpecification
.Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOne
Methods inherited from interface com.totvs.tjf.api.jpa.data.repository.JpaSpecificationProjectionExecutor
findAllProjectedBy, findAllProjectedBy, findAllProjectedBy, findOneProjectedBy
-
Method Details
-
findOneProjected
@Deprecated(since="3.0.0-RELEASE", forRemoval=true) default <P> Optional<P> findOneProjected(@Nullable org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, @Nullable com.totvs.tjf.api.context.request.ApiFieldRequest fieldRequest) Deprecated, for removal: This API element is subject to removal in a future version.Returns a single entity matching the givenSpecification
orOptional.empty()
if none found.- Parameters:
specs
- can be null.projectionClass
- the projection to be used, must not be null.fieldRequest
- the 'fields' to be restricted in the SQL, can be null.- Returns:
- an
Optional
instance with the requested entity if found, otherwiseOptional.empty()
- Throws:
org.springframework.dao.IncorrectResultSizeDataAccessException
- if more than one entity found.
-
findAllProjected
@Deprecated(since="3.0.0-RELEASE", forRemoval=true) default <P> List<P> findAllProjected(@Nullable org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, org.springframework.data.domain.Pageable pageable) Deprecated, for removal: This API element is subject to removal in a future version.Returns all entities matching the givenSpecification
.- Parameters:
specs
- can be null.projectionClass
- the projection to be used, must not be null.pageable
- must not be null.- Returns:
- a
List
with the entities found, otherwiseCollections.emptyList()
-
findPageProjected
@Deprecated(since="3.0.0-RELEASE", forRemoval=true) default <P> org.springframework.data.domain.Page<P> findPageProjected(@Nullable org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass, org.springframework.data.domain.Pageable pageable) Deprecated, for removal: This API element is subject to removal in a future version.Returns aPage
of entities matching the givenSpecification
.- Parameters:
specs
- can be null.projectionClass
- the projection to be used, must not be null.pageable
- must not be null.- Returns:
- a
Page
with the entities found.
-
findOneProjected
@Deprecated(since="3.0.0-RELEASE", forRemoval=true) default <P> Optional<P> findOneProjected(@Nullable org.springframework.data.jpa.domain.Specification<T> specs, Class<P> projectionClass) Deprecated, for removal: This API element is subject to removal in a future version.
-
Specifications
based on the JPA criteria API with projection based queries.This implementation is a work around for the problem described in DATAJPA-1033 issue.