Interface ApiJpaRepository<T>

    • 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 the ApiPageRequest with ApiSortRequest.
      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 given Specification for the ApiPageRequest with ApiSortRequest.
      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 given Specification for the ApiPageRequest.
      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 the ApiFieldRequest, for the ApiPageRequest.
      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 the ApiFieldRequest, for the ApiPageRequest with ApiSortRequest.
      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 the ApiFieldRequest, matching the given Specification for the ApiPageRequest with ApiSortRequest.
      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 the ApiFieldRequest, matching the given Specification for the ApiPageRequest.
      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 the ApiPageRequest.
      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 the ApiPageRequest.
      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 the ApiPageRequest with ApiSortRequest.
      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 the ApiPageRequest with ApiSortRequest.
      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 given Specification for the ApiPageRequest with ApiSortRequest.
      <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 given Specification for the ApiPageRequest with ApiSortRequest.
      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 given Specification for the ApiPageRequest.
      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 given Specification for the ApiPageRequest.
      Optional<T> findOne​(org.springframework.data.jpa.domain.Specification<T> specs)
      Returns a single entity, matching the given Specification or Optional.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 the ApiFieldRequest, matching the given Specification or Optional.empty() if none found.
      default boolean hasMorePages​(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
      Checks if the ApiPageRequest 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 the ApiPageRequest, matching the given Specification, has at least one record in the next page.
    • 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 the ApiFieldRequest, matching the given Specification or Optional.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, otherwise Optional.empty().
      • findOne

        Optional<T> findOne​(@Nullable
                            org.springframework.data.jpa.domain.Specification<T> specs)
        Returns a single entity, matching the given Specification or Optional.empty() if none found.
        Parameters:
        specs - can be null.
        Returns:
        an Optional instance with the projections of the requested entity if found any, otherwise Optional.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 the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiFieldRequest, for the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiFieldRequest, matching the given Specification for the ApiPageRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiFieldRequest, for the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 the ApiFieldRequest, matching the given Specification for the ApiPageRequest with ApiSortRequest.
        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 empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest.
        Parameters:
        pageRequest - can be null.
        specs - can be null.
        Returns:
        a ApiJpaCollectionResult with the entities found, otherwise an empty ApiJpaCollectionResult.
      • 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 the ApiPageRequest with ApiSortRequest.
        Parameters:
        pageRequest - can be null.
        sortRequest - can be null.
        Returns:
        a ApiJpaCollectionResult with the entities found, otherwise an empty ApiJpaCollectionResult.
      • 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 given Specification for the ApiPageRequest with ApiSortRequest.
        Parameters:
        pageRequest - can be null.
        sortRequest - can be null.
        specs - can be null.
        Returns:
        a ApiJpaCollectionResult with the entities found, otherwise an empty ApiJpaCollectionResult.
      • hasMorePages

        default boolean hasMorePages​(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest)
        Checks if the ApiPageRequest 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, otherwise false
      • hasMorePages

        boolean hasMorePages​(com.totvs.tjf.core.api.context.request.ApiPageRequest pageRequest,
                             @Nullable
                             org.springframework.data.jpa.domain.Specification<T> specs)
        Checks if the ApiPageRequest, matching the given Specification, 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, otherwise false