diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/TagDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/TagDao.java index a7655dab..5209be6e 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/TagDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/TagDao.java @@ -1,7 +1,10 @@ package one.nem.lacerta.source.database.dao; import androidx.room.Dao; +import androidx.room.Delete; +import androidx.room.Insert; import androidx.room.Query; +import androidx.room.Update; import java.util.List; @@ -10,6 +13,8 @@ import one.nem.lacerta.source.database.entity.Tag; @Dao public interface TagDao { + // Select + @Query("SELECT * FROM tag WHERE id = :id") Tag findById(String id); @@ -19,6 +24,37 @@ public interface TagDao { @Query("SELECT * FROM tag WHERE id IN (:ids)") List findByIds(List ids); - // WIP - // TODO-rca: Insert, Update, Delete + // Insert + @Insert + void insert(Tag tag); + + @Insert + void insertAll(Tag... tags); + + @Insert + void insertAll(List tags); + + // Update + @Update + void update(Tag tag); + + @Update + void updateAll(Tag... tags); + + @Update + void updateAll(List tags); + + // Delete + @Delete + void delete(Tag tag); + + @Delete + void deleteAll(Tag... tags); + + @Delete + void deleteAll(List tags); + + @Delete + void deleteById(String id); + }