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 Type
    Method
    Description
    int
     
     

    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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

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

    findAll, findAllById, saveAll

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

    findAll

    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

    • findAllByServiceIdOrderByGeneratedAtDesc

      List<ReportHistoryEntity> findAllByServiceIdOrderByGeneratedAtDesc(Long serviceId)
    • deleteByGeneratedAtBefore

      @Modifying @Query("DELETE FROM ReportHistoryEntity r WHERE r.generatedAt < :threshold") int deleteByGeneratedAtBefore(@Param("threshold") LocalDateTime threshold)