Interface ReportHistoryRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ReportHistoryEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<ReportHistoryEntity,,Long> org.springframework.data.repository.ListCrudRepository<ReportHistoryEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<ReportHistoryEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<ReportHistoryEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<ReportHistoryEntity>,org.springframework.data.repository.Repository<ReportHistoryEntity,Long>
@Repository
public interface ReportHistoryRepository
extends org.springframework.data.jpa.repository.JpaRepository<ReportHistoryEntity,Long>
Spring Data JPA repository for
ReportHistoryEntity.
Provides finder methods for listing report history by service and bulk deletion by age used by the data-retention service.
- Author:
- Nazar Montytskyi
-
Method Summary
Modifier and TypeMethodDescriptionintdeleteByGeneratedAtBefore(LocalDateTime threshold) findAllByServiceIdOrderByGeneratedAtDesc(Long serviceId) 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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods 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
-
findAllByServiceIdOrderByGeneratedAtDesc
-
deleteByGeneratedAtBefore
@Modifying @Query("DELETE FROM ReportHistoryEntity r WHERE r.generatedAt < :threshold") int deleteByGeneratedAtBefore(@Param("threshold") LocalDateTime threshold)
-