Package sk.iway.iwcm.rag.jpa
Interface IndexQueueRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<IndexQueueEntity,,Long> DomainIdRepository<IndexQueueEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<IndexQueueEntity,,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<IndexQueueEntity>,org.springframework.data.repository.ListCrudRepository<IndexQueueEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<IndexQueueEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<IndexQueueEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<IndexQueueEntity>,org.springframework.data.repository.Repository<IndexQueueEntity,Long>
Spring Data repository for
IndexQueueEntity.
Provides methods to query, insert, and delete RAG indexing queue entries.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object> -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByEntityTypeAndEntityId(RagEntityType entityType, Long entityId, Integer domainId) Deletes pending actions for one source in the specified accounting domain.voiddeleteByEntityTypeAndEntityId(RagEntityType entityType, List<Long> entityIds, Integer domainId) Deletes pending actions for selected sources in the specified accounting domain.findByEntityTypeAndSourcePathStartingWith(RagEntityType entityType, String sourcePath) Finds pending source actions across submitting domains by logical path prefix.findExistingEntityIds(RagEntityType entityType, RagIndexAction action, Integer domainId) Returns entity IDs queued for the specified action in one accounting domain.Returns the highest queue ID for establishing a processing snapshot.findTop500ByIdGreaterThanAndIdLessThanEqualOrderByIdAsc(Long afterId, Long maxId) Returns the next stable queue batch within a cron run's initial ID snapshot.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface sk.iway.iwcm.system.datatable.spring.DomainIdRepository
findAllByDomainId, findAllByDomainId, findAllByIdInAndDomainId, findFirstByIdAndDomainIdMethods 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.jpa.repository.JpaSpecificationExecutor
count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, updateMethods 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
-
findTop500ByOrderByCreateDateAsc
List<IndexQueueEntity> findTop500ByOrderByCreateDateAsc() -
findMaxId
Returns the highest queue ID for establishing a processing snapshot.- Returns:
- highest current queue ID, or
nullfor an empty queue
-
findTop500ByIdGreaterThanAndIdLessThanEqualOrderByIdAsc
List<IndexQueueEntity> findTop500ByIdGreaterThanAndIdLessThanEqualOrderByIdAsc(Long afterId, Long maxId) Returns the next stable queue batch within a cron run's initial ID snapshot. The cursor ensures failed or undeletable rows are attempted only once per run, while later rows from the same snapshot can still be processed.- Parameters:
afterId- last queue ID attempted in the current runmaxId- highest queue ID included in the current run- Returns:
- up to 500 subsequent queue rows
-
deleteByEntityTypeAndEntityId
@Modifying @Transactional @Query("DELETE FROM IndexQueueEntity q WHERE q.entityType = :entityType AND q.entityId = :entityId AND q.domainId = :domainId") void deleteByEntityTypeAndEntityId(@Param("entityType") RagEntityType entityType, @Param("entityId") Long entityId, @Param("domainId") Integer domainId) Deletes pending actions for one source in the specified accounting domain.- Parameters:
entityType- source entity typeentityId- source identifierdomainId- accounting domain whose entries are removed
-
deleteByEntityTypeAndEntityId
@Modifying @Transactional @Query("DELETE FROM IndexQueueEntity q WHERE q.entityType = :entityType AND q.entityId IN :entityIds AND q.domainId = :domainId") void deleteByEntityTypeAndEntityId(@Param("entityType") RagEntityType entityType, @Param("entityIds") List<Long> entityIds, @Param("domainId") Integer domainId) Deletes pending actions for selected sources in the specified accounting domain.- Parameters:
entityType- source entity typeentityIds- source identifiersdomainId- accounting domain whose entries are removed
-
findExistingEntityIds
@Query("SELECT q.entityId FROM IndexQueueEntity q WHERE q.entityType = :entityType AND q.action = :action AND q.domainId = :domainId") List<Long> findExistingEntityIds(@Param("entityType") RagEntityType entityType, @Param("action") RagIndexAction action, @Param("domainId") Integer domainId) Returns entity IDs queued for the specified action in one accounting domain.- Parameters:
entityType- source entity typeaction- queued actiondomainId- accounting domain to filter by- Returns:
- matching queued entity IDs
-
findByEntityTypeAndSourcePathStartingWith
List<IndexQueueEntity> findByEntityTypeAndSourcePathStartingWith(RagEntityType entityType, String sourcePath) Finds pending source actions across submitting domains by logical path prefix.- Parameters:
entityType- source entity typesourcePath- logical path prefix, normally the root followed by a slash- Returns:
- matching queue entries from all domains
-