diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java index ab875d3a..60fefe18 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/DocumentDao.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; @@ -11,6 +14,8 @@ import one.nem.lacerta.source.database.entity.Document; @Dao public interface DocumentDao { + // Select + @Query("SELECT * FROM document WHERE id = :id") Document findById(String id); @@ -18,10 +23,40 @@ public interface DocumentDao { List findAll(); @Query("SELECT * FROM document WHERE id IN (:ids)") - List findByIds(List ids); - // WIP - // TODO-rca: Insert, Update, Delete + // Insert + @Insert + void insert(Document document); + + @Insert + void insertAll(Document... documents); + + @Insert + void insertAll(List documents); + + // Update + + @Update + void update(Document document); + + @Update + void updateAll(Document... documents); + + @Update + void updateAll(List documents); + + // Delete + @Delete + void delete(Document document); + + @Delete + void deleteAll(Document... documents); + + @Delete + void deleteAll(List documents); + + @Delete + void deleteById(String id); }