Package com.totvs.tjf.api.jpa.repository
Interface ApiJpaRepository<T>
-
- All Superinterfaces:
ApiJpaQueryByExampleWithDynamicProjection<T>
- All Known Implementing Classes:
ApiJpaRepositoryImpl
@NoRepositoryBean public interface ApiJpaRepository<T> extends ApiJpaQueryByExampleWithDynamicProjection<T>
Standard interface to JPA repository.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAll(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAll(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAll(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, matching the givenSpecification
for theApiPageRequest
.default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAllProjected(com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, for theApiPageRequest
.default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAllProjected(com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, for theApiPageRequest
withApiSortRequest
.com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAllProjected(com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T>
findAllProjected(com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
for theApiPageRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Returns all entities for theApiPageRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities for theApiPageRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.<P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, org.springframework.data.jpa.domain.Specification<T> specs, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities matching the givenSpecification
for theApiPageRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(Class<P> projectionClass, com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, org.springframework.data.jpa.domain.Specification<T> specs, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities matching the givenSpecification
for theApiPageRequest
.Optional<T>
findOne(org.springframework.data.jpa.domain.Specification<T> specs)
Returns a single entity, matching the givenSpecification
orOptional.empty()
if none found.Optional<T>
findOneProjected(org.springframework.data.jpa.domain.Specification<T> specs, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns a single entity, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
orOptional.empty()
if none found.default boolean
hasMorePages(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Checks if theApiPageRequest
has at least one record in the next page.boolean
hasMorePages(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, org.springframework.data.jpa.domain.Specification<T> specs)
Checks if theApiPageRequest
, matching the givenSpecification
, has at least one record in the next page.-
Methods inherited from interface com.totvs.tjf.api.jpa.repository.ApiJpaQueryByExampleWithDynamicProjection
findAllProjected, findAllProjected, findAllProjected, findOneProjected
-
-
-
-
Method Detail
-
findOneProjected
Optional<T> findOneProjected(@Nullable org.springframework.data.jpa.domain.Specification<T> specs, @Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns a single entity, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
orOptional.empty()
if none found.- Parameters:
specs
- can be null.fieldRequest
- the 'fields' to be restricted in the SQL, can be null.- Returns:
- an
Optional
instance with the projections of the requested entity if found any, otherwiseOptional.empty()
.
-
findOne
Optional<T> findOne(@Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns a single entity, matching the givenSpecification
orOptional.empty()
if none found.- Parameters:
specs
- can be null.- Returns:
- an
Optional
instance with the projections of the requested entity if found any, otherwiseOptional.empty()
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Returns all entities for theApiPageRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities for theApiPageRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.fieldRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities matching the givenSpecification
for theApiPageRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs, @Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities matching the givenSpecification
for theApiPageRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.specs
- can be null.fieldRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.sortRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.sortRequest
- can be null.fieldRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.sortRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
<P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P> findAllProjected(Class<P> projectionClass, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs, @Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest)
Returns all entities matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.- Parameters:
projectionClass
- the projection to be used, must not be null.pageRequest
- can be null.sortRequest
- can be null.specs
- can be null.fieldRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAllProjected(@Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, for theApiPageRequest
.- Parameters:
fieldRequest
- the 'fields' to be restricted in the SQL, can be null.pageRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAllProjected(@Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
for theApiPageRequest
.- Parameters:
fieldRequest
- the 'fields' to be restricted in the SQL, can be null.pageRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAllProjected(@Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, for theApiPageRequest
withApiSortRequest
.- Parameters:
fieldRequest
- the 'fields' to be restricted in the SQL, can be null.pageRequest
- can be null.sortRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAllProjected
com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAllProjected(@Nullable com.totvs.tjf.core.api.context.request.ApiFieldRequest fieldRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, with restricted 'fields' by theApiFieldRequest
, matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.- Parameters:
fieldRequest
- the 'fields' to be restricted in the SQL, can be null.pageRequest
- can be null.sortRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAll
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAll(@Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, matching the givenSpecification
for theApiPageRequest
.- Parameters:
pageRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAll
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAll(@Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest)
Returns all entities for theApiPageRequest
withApiSortRequest
.- Parameters:
pageRequest
- can be null.sortRequest
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the entities found, otherwise an emptyApiJpaCollectionResult
.
-
findAll
default com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<T> findAll(@Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sortRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Returns all entities, matching the givenSpecification
for theApiPageRequest
withApiSortRequest
.- Parameters:
pageRequest
- can be null.sortRequest
- can be null.specs
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the entities found, otherwise an emptyApiJpaCollectionResult
.
-
hasMorePages
default boolean hasMorePages(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
Checks if theApiPageRequest
has at least one record in the next page.- Parameters:
pageRequest
- the current page, must not be null.- Returns:
true
if has at least one record in the next page, otherwisefalse
-
hasMorePages
boolean hasMorePages(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest, @Nullable org.springframework.data.jpa.domain.Specification<T> specs)
Checks if theApiPageRequest
, matching the givenSpecification
, has at least one record in the next page.- Parameters:
pageRequest
- the current page, must not be null.specs
- can be null.- Returns:
true
if has at least one record in the next page, otherwisefalse
-
-