pull/32/head
kunfei 5 years ago
parent 9a6d5e06ef
commit 0934ee4b4a
  1. 1
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  2. 18
      app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt

@ -57,4 +57,5 @@ abstract class AppDatabase : RoomDatabase() {
abstract fun searchKeywordDao(): SearchKeywordDao abstract fun searchKeywordDao(): SearchKeywordDao
abstract fun sourceCookieDao(): SourceCookieDao abstract fun sourceCookieDao(): SourceCookieDao
abstract fun rssSourceDao(): RssSourceDao abstract fun rssSourceDao(): RssSourceDao
abstract fun bookmarkDao(): BookmarkDao
} }

@ -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<Bookmark>
@Query("select * from bookmarks where bookUrl = :bookUrl")
fun observeByBook(bookUrl: String): DataSource.Factory<Int, Bookmark>
}
Loading…
Cancel
Save