diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java index 21e1cc2e..7b410ba4 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java @@ -29,13 +29,13 @@ public interface DocumentDao { @Query("SELECT * FROM Document WHERE id IN (:ids)") List findByIds(List 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 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 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 getRecentDocument(int limit); // Insert