From a1b6ed81df99995190d22484d06ca34be9eb7294 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 14 Jan 2024 13:25:29 +0900 Subject: [PATCH] =?UTF-8?q?VcsLogDao=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/database/dao/VcsLogDao.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java index d8efcff2..cd15c89a 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java @@ -1,7 +1,39 @@ package one.nem.lacerta.source.database.dao; import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.database.entity.VcsLogEntity; @Dao public interface VcsLogDao { + + // Select + @Query("SELECT * FROM vcs_log WHERE id = :id") + VcsLogEntity findById(String id); + + @Query("SELECT * FROM vcs_log") + List findAll(); + + @Query("SELECT * FROM vcs_log WHERE id IN (:ids)") + List findByIds(List ids); + + @Query("SELECT * FROM vcs_log WHERE document_id = :documentId") + List findByDocumentId(String documentId); + + // Insert + + @Insert + void insertAll(VcsLogEntity... vcsLogs); + + @Insert + void insertAll(List vcsLogs); + + @Insert + void insert(VcsLogEntity vcsLog); + + // TODO-rca: Update, Deleteが必要か検討 }