From 0934ee4b4a08a12b4885d1e0d0c94dcebb900736 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 8 Aug 2019 22:04:23 +0800 Subject: [PATCH] up --- .../java/io/legado/app/data/AppDatabase.kt | 1 + .../java/io/legado/app/data/dao/BookmarkDao.kt | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt index 5fdff03e0..d58a5ccb7 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -57,4 +57,5 @@ abstract class AppDatabase : RoomDatabase() { abstract fun searchKeywordDao(): SearchKeywordDao abstract fun sourceCookieDao(): SourceCookieDao abstract fun rssSourceDao(): RssSourceDao + abstract fun bookmarkDao(): BookmarkDao } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt b/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt new file mode 100644 index 000000000..eb757c547 --- /dev/null +++ b/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt @@ -0,0 +1,18 @@ +package io.legado.app.data.dao + +import androidx.paging.DataSource +import androidx.room.Dao +import androidx.room.Query +import io.legado.app.data.entities.Bookmark + + +@Dao +interface BookmarkDao { + + @Query("select * from bookmarks") + fun all(): List + + @Query("select * from bookmarks where bookUrl = :bookUrl") + fun observeByBook(bookUrl: String): DataSource.Factory + +} \ No newline at end of file