From 2ccc576c69ae7a532224cd11b7aa6d7f565b6762 Mon Sep 17 00:00:00 2001 From: r-ca Date: Thu, 14 Dec 2023 02:42:25 +0900 Subject: [PATCH] =?UTF-8?q?source:=20Dao:=20WIP,=20LibraryDao=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/database/dao/LibraryDao.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/LibraryDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/LibraryDao.java index ce86fdcc..87a05162 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/LibraryDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/LibraryDao.java @@ -1,4 +1,24 @@ 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.Library; + +@Dao public interface LibraryDao { + + @Query("SELECT * FROM library WHERE id = :id") + Library findById(String id); + + @Query("SELECT * FROM library") + List findAll(); + + @Query("SELECT * FROM library WHERE id IN (:ids)") + List findByIds(List ids); + + // WIP + // TODO-rca: Insert, Update, Delete }