From c82952f397a3ec074f43472db6c825bdcf1275e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Wed, 17 Jan 2024 12:11:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=82=AD=E3=83=BC=E3=83=9E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0,=20Dao=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/database/dao/FolderDao.java | 15 +++++++++++++++ .../source/database/entity/FolderEntity.java | 3 +++ 2 files changed, 18 insertions(+) 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 be3ccbe7..1d429245 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 @@ -1,8 +1,23 @@ package one.nem.lacerta.source.database.dao; import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.Query; + +import one.nem.lacerta.source.database.entity.FolderEntity; @Dao public interface FolderDao { + @Query("SELECT * FROM Folder WHERE id = :id") + FolderEntity findById(String id); + + @Query("SELECT * FROM Folder WHERE public_path = :publicPath") + FolderEntity findByPublicPath(String publicPath); + + @Insert + void insert(FolderEntity folderEntity); + + @Insert + void insertAll(FolderEntity... folderEntities); } diff --git a/source/src/main/java/one/nem/lacerta/source/database/entity/FolderEntity.java b/source/src/main/java/one/nem/lacerta/source/database/entity/FolderEntity.java index d8236696..f3a9091d 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/entity/FolderEntity.java +++ b/source/src/main/java/one/nem/lacerta/source/database/entity/FolderEntity.java @@ -16,4 +16,7 @@ public class FolderEntity { @ColumnInfo(name = "title") public String name; // フォルダ名 + @ColumnInfo(name = "public_path") + public String publicPath; // 公開パス + }