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; // 公開パス + }