diff --git a/data/src/main/java/one/nem/lacerta/source/db/dao/DocumentsDao.java b/data/src/main/java/one/nem/lacerta/source/db/dao/DocumentsDao.java new file mode 100644 index 00000000..8cf66b47 --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/source/db/dao/DocumentsDao.java @@ -0,0 +1,26 @@ +package one.nem.lacerta.source.db.dao; + + +import androidx.room.Dao; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.db.entity.Documents; + +@Dao +public interface DocumentsDao { + + @Query("SELECT * FROM documents") + List getAll(); + + @Query("SELECT * FROM documents WHERE id IN (:ids)") + List loadAllByIds(int[] ids); + + @Query("SELECT * FROM documents WHERE title LIKE :title LIMIT 1") + Documents findByTitle(String title); + + @Query("SELECT * FROM documents WHERE id LIKE :id LIMIT 1") + Documents findById(String id); + +}