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 TypeMethodDescriptionfindByStateIn(List<String> states) findStateById(long campaignId) The CURRENT persisted state of a campaign, read as a SCALAR projection: a projection query always goes to the database, unlikefindById, 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, 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
-
findByStateIn
-
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, unlikefindById, 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
-