Interface CleanupCampaignDAO

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

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

    Modifier and Type
    Method
    Description
     
    findStateById(long campaignId)
    The CURRENT persisted state of a campaign, read as a SCALAR projection: a projection query always goes to the database, unlike findById, which answers the persistence context's cached entity.

    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

    • findByStateIn

      List<CleanupCampaignEntity> findByStateIn(List<String> states)
    • findStateById

      @Query("SELECT c.state FROM CleanupCampaign c WHERE c.id = :campaignId") String findStateById(@Param("campaignId") long campaignId)
      The CURRENT persisted state of a campaign, read as a SCALAR projection: a projection query always goes to the database, unlike findById, which answers the persistence context's cached entity. The scan workers poll the abort state inside LONG-lived transactions (a coordinator spans the whole run, the writer idles between batches without restarting), where an entity re-read is the scan-start snapshot — a cancel could go unobserved for hours, and a terminal state could be overwritten from a stale model.
      Parameters:
      campaignId - campaign identifier
      Returns:
      the persisted state name, null when the row is gone