From 31799218a9c151c1ef89ce41dec8417a730259a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 14 Dec 2023 11:55:20 +0900 Subject: [PATCH] =?UTF-8?q?Insert=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/database/dao/LibraryDao.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 8948b9dd..96cb18a9 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,6 +1,7 @@ package one.nem.lacerta.source.database.dao; import androidx.room.Dao; +import androidx.room.Insert; import androidx.room.Query; import java.util.List; @@ -10,6 +11,7 @@ import one.nem.lacerta.source.database.entity.LibraryEntity; @Dao public interface LibraryDao { + // Select @Query("SELECT * FROM Library WHERE id = :id") LibraryEntity findById(String id); @@ -19,6 +21,17 @@ public interface LibraryDao { @Query("SELECT * FROM Library WHERE id IN (:ids)") List findByIds(List ids); - // WIP - // TODO-rca: Insert, Update, Delete + + // Insert + @Insert + void insert(LibraryEntity libraryEntity); + + @Insert + void insertAll(LibraryEntity... libraryEntities); + + @Insert + void insertAll(List libraryEntities); + + // Update + // TODO-rca: 未実装 }