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
A common repository for inheritance of common methods for Entities extending BaseEntity.
- Since:
- 3.3.0
-
Method Summary
Modifier and TypeMethodDescriptiondeleteByIdIn(Set<Long> ids) Delete all entities whose ids are contained in the given set of ids.booleanexistsByUniqueId(String uniqueId) Find out whether an entity with the given unique id exists.findByUniqueId(String uniqueId) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOneMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUniqueId
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
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 fortype- The entity or projection type to return- Returns:
- The entity found or empty Optional
-
existsByUniqueId
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
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
-