Package sk.iway.iwcm.rag.pgvector
Interface EmbeddingChunkRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<EmbeddingChunkEntity,,Long> DomainIdRepository<EmbeddingChunkEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<EmbeddingChunkEntity,,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<EmbeddingChunkEntity>,org.springframework.data.repository.ListCrudRepository<EmbeddingChunkEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<EmbeddingChunkEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<EmbeddingChunkEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<EmbeddingChunkEntity>,org.springframework.data.repository.Repository<EmbeddingChunkEntity,Long>
@Repository
public interface EmbeddingChunkRepository
extends DomainIdRepository<EmbeddingChunkEntity,Long>
Spring Data repository for
EmbeddingChunkEntity.
Provides JPA query methods for managing embedding chunks in the rag_embedding_chunks table.
Note: the actual embedding vector column is managed via native SQL in PgVectorStore.-
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 TypeMethodDescriptionvoiddeleteByEntityTypeAndEntityIdAndDomainId(RagEntityType entityType, Long entityId, Integer domainId) voiddeleteByEntityTypeAndEntityIdAndEmbeddingModelAndDomainId(RagEntityType entityType, Long entityId, String embeddingModel, Integer domainId) findDistinctEntityIdsByEntityTypeAndDomainId(RagEntityType entityType, Integer domainId) findDistinctEntityTypes(Integer domainId) intupdateDocumentGroupData(Long entityId, Integer groupId, Integer rootGroupL1, Integer rootGroupL2, Integer rootGroupL3) 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, 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
-
deleteByEntityTypeAndEntityIdAndDomainId
@Transactional @Modifying @Query("DELETE FROM EmbeddingChunkEntity c WHERE c.entityType = :entityType AND c.entityId = :entityId AND c.domainId = :domainId") void deleteByEntityTypeAndEntityIdAndDomainId(@Param("entityType") RagEntityType entityType, @Param("entityId") Long entityId, @Param("domainId") Integer domainId) -
deleteByEntityTypeAndEntityIdAndEmbeddingModelAndDomainId
@Transactional @Modifying @Query("DELETE FROM EmbeddingChunkEntity c WHERE c.entityType = :entityType AND c.entityId = :entityId AND c.embeddingModel = :embeddingModel AND c.domainId = :domainId") void deleteByEntityTypeAndEntityIdAndEmbeddingModelAndDomainId(@Param("entityType") RagEntityType entityType, @Param("entityId") Long entityId, @Param("embeddingModel") String embeddingModel, @Param("domainId") Integer domainId) -
findDistinctEntityTypes
@Query("SELECT DISTINCT c.entityType FROM EmbeddingChunkEntity c WHERE c.domainId = :domainId") List<RagEntityType> findDistinctEntityTypes(@Param("domainId") Integer domainId) -
findDistinctEntityIdsByEntityTypeAndDomainId
@Query("SELECT DISTINCT c.entityId FROM EmbeddingChunkEntity c WHERE c.entityType = :entityType AND c.domainId = :domainId") List<Integer> findDistinctEntityIdsByEntityTypeAndDomainId(RagEntityType entityType, Integer domainId) -
findDistinctDocumentEntityIdsWithIncompleteGroupData
-
updateDocumentGroupData
@Transactional @Modifying @Query("UPDATE EmbeddingChunkEntity c SET c.groupId = :groupId, c.rootGroupL1 = :rootGroupL1, c.rootGroupL2 = :rootGroupL2, c.rootGroupL3 = :rootGroupL3 WHERE c.entityType = sk.iway.iwcm.rag.service.RagEntityType.DOCUMENT AND c.entityId = :entityId") int updateDocumentGroupData(@Param("entityId") Long entityId, @Param("groupId") Integer groupId, @Param("rootGroupL1") Integer rootGroupL1, @Param("rootGroupL2") Integer rootGroupL2, @Param("rootGroupL3") Integer rootGroupL3)
-