From 09a47d4b1587febd0383f93c384b074490fe072a Mon Sep 17 00:00:00 2001 From: atbest Date: Wed, 22 May 2019 06:52:49 -0400 Subject: [PATCH] Update database --- .../java/io/legado/app/data/dao/BookDao.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/src/main/java/io/legado/app/data/dao/BookDao.kt diff --git a/app/src/main/java/io/legado/app/data/dao/BookDao.kt b/app/src/main/java/io/legado/app/data/dao/BookDao.kt new file mode 100644 index 000000000..b6ad0ba40 --- /dev/null +++ b/app/src/main/java/io/legado/app/data/dao/BookDao.kt @@ -0,0 +1,19 @@ +package io.legado.app.data.dao + +import androidx.lifecycle.LiveData +import androidx.paging.DataSource +import androidx.room.Dao +import androidx.room.Query +import io.legado.app.data.entities.Book + + +@Dao +interface BookDao { + + @Query("SELECT * FROM books WHERE `group` = :group") + fun observeByGroup(group: Int): DataSource.Factory + + @Query("SELECT url FROM books WHERE `group` = :group") + fun observeUrlsByGroup(group: Int): LiveData> + +} \ No newline at end of file