From c7f2a3eebee793b2258152f8739abbb99e5e7044 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 22 Jan 2024 23:28:15 +0900 Subject: [PATCH] =?UTF-8?q?Dao=E3=82=AF=E3=82=A8=E3=83=AA=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/source/database/dao/DocumentDao.java | 3 +++ .../java/one/nem/lacerta/source/database/dao/FolderDao.java | 3 +++ 2 files changed, 6 insertions(+) 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 f3a3fd2b..21e1cc2e 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 @@ -32,6 +32,9 @@ public interface DocumentDao { @Query("SELECT * FROM Document WHERE parent_id = :parentId") List findByParentId(String parentId); + @Query("SELECT * FROM Document WHERE parent_id IS NULL") + List findRootDocuments(); + @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 af5e92d4..404b53f8 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 @@ -18,6 +18,9 @@ public interface FolderDao { @Query("SELECT * FROM Folder WHERE parent_id = :parentId") List findByParentId(String parentId); + @Query("SELECT * FROM Folder WHERE parent_id IS NULL") + List findRootFolders(); + @Insert void insert(FolderEntity folderEntity);