DocumentDaoのSelectクエリを修正(CombineのChildを含めないように

This commit is contained in:
r-ca 2024-01-27 17:13:51 +09:00
parent 4ffcd970b4
commit 98b141f96f
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -29,13 +29,13 @@ public interface DocumentDao {
@Query("SELECT * FROM Document WHERE id IN (:ids)") @Query("SELECT * FROM Document WHERE id IN (:ids)")
List<DocumentEntity> findByIds(List<String> ids); List<DocumentEntity> findByIds(List<String> ids);
@Query("SELECT * FROM Document WHERE parent_id = :parentId") @Query("SELECT * FROM Document WHERE parent_id = :parentId AND is_combine_child = 0 ORDER BY created_at DESC")
List<DocumentEntity> findByParentId(String parentId); List<DocumentEntity> findByParentId(String parentId);
@Query("SELECT * FROM Document WHERE parent_id IS NULL") @Query("SELECT * FROM Document WHERE parent_id IS NULL AND is_combine_child = 0 ORDER BY created_at DESC")
List<DocumentEntity> findRootDocuments(); List<DocumentEntity> findRootDocuments();
@Query("SELECT * FROM Document ORDER BY created_at DESC LIMIT :limit") @Query("SELECT * FROM Document WHERE is_combine_child = 0 ORDER BY created_at DESC LIMIT :limit")
List<DocumentEntity> getRecentDocument(int limit); List<DocumentEntity> getRecentDocument(int limit);
// Insert // Insert