Package com.totvs.tjf.api.jpa.repository
Interface ApiJpaQueryByExampleWithDynamicProjection<T>
-
- All Known Subinterfaces:
ApiJpaRepository<T>
- All Known Implementing Classes:
ApiJpaRepositoryImpl
@NoRepositoryBean public interface ApiJpaQueryByExampleWithDynamicProjection<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(org.springframework.data.domain.Example<T> example, Class<P> projection, com.totvs.tjf.core.api.context.request.ApiPageRequest page)
Returns all entities for theApiPageRequest
.default <P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(org.springframework.data.domain.Example<T> example, Class<P> projection, com.totvs.tjf.core.api.context.request.ApiPageRequest page, com.totvs.tjf.core.api.context.request.ApiSortRequest sort)
Returns all entities for theApiPageRequest
.<P> com.totvs.tjf.core.api.jpa.repository.ApiJpaCollectionResult<P>
findAllProjected(org.springframework.data.domain.Example<T> example, Class<P> projection, com.totvs.tjf.core.api.context.request.ApiSortedPageRequest sortedPage)
Returns all entities for theApiPageRequest
.<P> Optional<P>
findOneProjected(org.springframework.data.domain.Example<T> example, Class<P> projection)
Returns a single entity matching the givenExample
orOptional.empty()
if none found.
-
-
-
Method Detail
-
findOneProjected
<P> Optional<P> findOneProjected(org.springframework.data.domain.Example<T> example, Class<P> projection)
Returns a single entity matching the givenExample
orOptional.empty()
if none found.- Parameters:
example
- can not be null.projection
- the projection to be used, must not 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(org.springframework.data.domain.Example<T> example, Class<P> projection, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest page)
Returns all entities for theApiPageRequest
.- Parameters:
example
- can not be null.projection
- the projection to be used, must not be null.page
- can not 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(org.springframework.data.domain.Example<T> example, Class<P> projection, @Nullable com.totvs.tjf.core.api.context.request.ApiPageRequest page, @Nullable com.totvs.tjf.core.api.context.request.ApiSortRequest sort)
Returns all entities for theApiPageRequest
.- Parameters:
example
- can not be null.projection
- the projection to be used, must not be null.page
- can not be null.sort
- 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(org.springframework.data.domain.Example<T> example, Class<P> projection, @Nullable com.totvs.tjf.core.api.context.request.ApiSortedPageRequest sortedPage)
Returns all entities for theApiPageRequest
.- Parameters:
example
- can not be null.projection
- the projection to be used, must not be null.sortedPage
- can be null.- Returns:
- a
ApiJpaCollectionResult
with the projections of entities found, otherwise an emptyApiJpaCollectionResult
.
-
-