Interface FailedToSendRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<FailedToSendEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<FailedToSendEntity,Long>, org.springframework.data.repository.ListCrudRepository<FailedToSendEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<FailedToSendEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<FailedToSendEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<FailedToSendEntity>, org.springframework.data.repository.Repository<FailedToSendEntity,Long>

public interface FailedToSendRepository extends org.springframework.data.jpa.repository.JpaRepository<FailedToSendEntity,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
    deleteOldestByCreatedAtBefore(Instant threshold, int limit)
     
     

    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

    • findAllByPermissionId

      List<FailedToSendEntity> findAllByPermissionId(UUID permissionId)
    • deleteAllByPermissionId

      void deleteAllByPermissionId(UUID permissionId)
    • deleteOldestByCreatedAtBefore

      @Transactional @Modifying @Query(value="WITH to_delete AS (\n SELECT id\n FROM failed_to_send_entity\n WHERE created_at < :threshold\n ORDER BY created_at\n LIMIT :limit\n FOR UPDATE SKIP LOCKED\n)\nDELETE FROM failed_to_send_entity\nWHERE id IN (SELECT id FROM to_delete)\n", nativeQuery=true) int deleteOldestByCreatedAtBefore(@Param("threshold") Instant threshold, @Param("limit") int limit)