Interface JpaBaseRepository<E extends BaseEntity>

Type Parameters:
E - The entity class to act on which must extend BaseEntity
All Superinterfaces:
org.springframework.data.repository.CrudRepository<E,Long>, org.springframework.data.jpa.repository.JpaRepository<E,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<E>, org.springframework.data.repository.PagingAndSortingRepository<E,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<E>, org.springframework.data.repository.Repository<E,Long>
All Known Subinterfaces:
JpaApplicationRepository, JpaClusterRepository, JpaCommandRepository, JpaJobRepository

@NoRepositoryBean public interface JpaBaseRepository<E extends BaseEntity>
A common repository for inheritance of common methods for Entities extending BaseEntity.
Since:
3.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Delete all entities whose ids are contained in the given set of ids.
    boolean
    Find out whether an entity with the given unique id exists.
    Find an entity by its unique id.
    <T> Optional<T>
    findByUniqueId(String uniqueId, Class<T> type)
    Find an entity by its unique id.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    count, exists, findAll, findAll, findAll, findOne

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByUniqueId

      Optional<E> findByUniqueId(String uniqueId)
      Find an entity by its unique id.
      Parameters:
      uniqueId - The unique id to find an entity for
      Returns:
      The entity found or empty Optional
    • findByUniqueId

      <T> Optional<T> findByUniqueId(String uniqueId, Class<T> type)
      Find an entity by its unique id.
      Type Parameters:
      T - The class type which is a projection of E
      Parameters:
      uniqueId - The unique id to find an entity for
      type - The entity or projection type to return
      Returns:
      The entity found or empty Optional
    • existsByUniqueId

      boolean existsByUniqueId(String uniqueId)
      Find out whether an entity with the given unique id exists.
      Parameters:
      uniqueId - The unique id to check for existence
      Returns:
      True if an entity with the unique id exists
    • deleteByIdIn

      @Modifying Long deleteByIdIn(Set<Long> ids)
      Delete all entities whose ids are contained in the given set of ids.
      Parameters:
      ids - The ids of the entities to delete
      Returns:
      The number of deleted entities