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 f5f1eb61..f3a3fd2b 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,8 +29,8 @@ public interface DocumentDao { @Query("SELECT * FROM Document WHERE id IN (:ids)") List findByIds(List ids); - @Query("SELECT * FROM Document WHERE public_path = :publicPath LIMIT :limit") - List findByPublicPathWithLimit(String publicPath, int limit); + @Query("SELECT * FROM Document WHERE parent_id = :parentId") + List findByParentId(String parentId); @Query("SELECT * FROM Document ORDER BY created_at DESC LIMIT :limit") List getRecentDocument(int limit); diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/FolderDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/FolderDao.java index 451854e5..af5e92d4 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/FolderDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/FolderDao.java @@ -15,11 +15,8 @@ public interface FolderDao { @Query("SELECT * FROM Folder WHERE id = :id") FolderEntity findById(String id); - @Query("SELECT * FROM Folder WHERE public_path = :publicPath") - FolderEntity findByPublicPath(String publicPath); - - @Query("SELECT * FROM Folder WHERE public_path = :publicPath LIMIT :limit") - List findByPublicPathWithLimit(String publicPath, int limit); + @Query("SELECT * FROM Folder WHERE parent_id = :parentId") + List findByParentId(String parentId); @Insert void insert(FolderEntity folderEntity);