From 6cadc2d75b86ab84dc422c6bfaaf8abc03083825 Mon Sep 17 00:00:00 2001 From: r-ca Date: Thu, 14 Dec 2023 02:40:30 +0900 Subject: [PATCH] =?UTF-8?q?source:=20Dao:=20WIP,=20DocumentDao=E4=BD=9C?= =?UTF-8?q?=E6=88=90=EF=BC=88=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/database/dao/Document.java | 4 --- .../source/database/dao/DocumentDao.java | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) delete mode 100644 source/src/main/java/one/nem/lacerta/source/database/dao/Document.java create mode 100644 source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/Document.java b/source/src/main/java/one/nem/lacerta/source/database/dao/Document.java deleted file mode 100644 index f0c7f646..00000000 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/Document.java +++ /dev/null @@ -1,4 +0,0 @@ -package one.nem.lacerta.source.database.dao; - -public interface Document { -} 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 new file mode 100644 index 00000000..ab875d3a --- /dev/null +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java @@ -0,0 +1,27 @@ +package one.nem.lacerta.source.database.dao; + +import androidx.room.Dao; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.database.entity.Document; + + +@Dao +public interface DocumentDao { + + @Query("SELECT * FROM document WHERE id = :id") + Document findById(String id); + + @Query("SELECT * FROM document") + List findAll(); + + @Query("SELECT * FROM document WHERE id IN (:ids)") + + List findByIds(List ids); + + // WIP + // TODO-rca: Insert, Update, Delete + +}