From 253c77d6f56876ed95deb507a073e3a258f7a0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 22 Jan 2024 20:00:45 +0900 Subject: [PATCH] =?UTF-8?q?Dao=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/source/database/dao/DocumentDao.java | 4 ++-- .../one/nem/lacerta/source/database/dao/FolderDao.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) 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);