Change to variable fields
This commit is contained in:
parent
b010fe940b
commit
2f1263c82c
|
@ -18,13 +18,13 @@ import java.util.*
|
|||
)
|
||||
data class Article(
|
||||
@PrimaryKey
|
||||
val id: String,
|
||||
var id: String,
|
||||
@ColumnInfo
|
||||
val date: Date,
|
||||
var date: Date,
|
||||
@ColumnInfo
|
||||
val title: String,
|
||||
var title: String,
|
||||
@ColumnInfo
|
||||
val author: String? = null,
|
||||
var author: String? = null,
|
||||
@ColumnInfo
|
||||
var rawDescription: String,
|
||||
@ColumnInfo
|
||||
|
@ -32,13 +32,13 @@ data class Article(
|
|||
@ColumnInfo
|
||||
var fullContent: String? = null,
|
||||
@ColumnInfo
|
||||
val img: String? = null,
|
||||
var img: String? = null,
|
||||
@ColumnInfo
|
||||
val link: String,
|
||||
var link: String,
|
||||
@ColumnInfo(index = true)
|
||||
val feedId: String,
|
||||
var feedId: String,
|
||||
@ColumnInfo(index = true)
|
||||
val accountId: Int,
|
||||
var accountId: Int,
|
||||
@ColumnInfo(defaultValue = "true")
|
||||
var isUnread: Boolean = true,
|
||||
@ColumnInfo(defaultValue = "false")
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.room.Relation
|
|||
|
||||
data class ArticleWithFeed(
|
||||
@Embedded
|
||||
val article: Article,
|
||||
var article: Article,
|
||||
@Relation(parentColumn = "feedId", entityColumn = "id")
|
||||
val feed: Feed,
|
||||
var feed: Feed,
|
||||
)
|
||||
|
|
|
@ -14,17 +14,17 @@ import androidx.room.*
|
|||
)
|
||||
data class Feed(
|
||||
@PrimaryKey
|
||||
val id: String,
|
||||
var id: String,
|
||||
@ColumnInfo
|
||||
val name: String,
|
||||
var name: String,
|
||||
@ColumnInfo
|
||||
var icon: String? = null,
|
||||
@ColumnInfo
|
||||
val url: String,
|
||||
var url: String,
|
||||
@ColumnInfo(index = true)
|
||||
var groupId: String,
|
||||
@ColumnInfo(index = true)
|
||||
val accountId: Int,
|
||||
var accountId: Int,
|
||||
@ColumnInfo(defaultValue = "false")
|
||||
var isNotification: Boolean = false,
|
||||
@ColumnInfo(defaultValue = "false")
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.room.Relation
|
|||
|
||||
data class FeedWithArticle(
|
||||
@Embedded
|
||||
val feed: Feed,
|
||||
var feed: Feed,
|
||||
@Relation(parentColumn = "id", entityColumn = "feedId")
|
||||
val articles: List<Article>
|
||||
var articles: List<Article>
|
||||
)
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.room.Relation
|
|||
|
||||
data class FeedWithGroup(
|
||||
@Embedded
|
||||
val feed: Feed,
|
||||
var feed: Feed,
|
||||
@Relation(parentColumn = "groupId", entityColumn = "id")
|
||||
val group: Group
|
||||
var group: Group
|
||||
)
|
||||
|
|
|
@ -8,11 +8,11 @@ import androidx.room.PrimaryKey
|
|||
@Entity(tableName = "group")
|
||||
data class Group(
|
||||
@PrimaryKey
|
||||
val id: String,
|
||||
var id: String,
|
||||
@ColumnInfo
|
||||
val name: String,
|
||||
var name: String,
|
||||
@ColumnInfo(index = true)
|
||||
val accountId: Int,
|
||||
var accountId: Int,
|
||||
) {
|
||||
@Ignore
|
||||
var important: Int? = 0
|
||||
|
|
|
@ -5,7 +5,7 @@ import androidx.room.Relation
|
|||
|
||||
data class GroupWithFeed(
|
||||
@Embedded
|
||||
val group: Group,
|
||||
var group: Group,
|
||||
@Relation(parentColumn = "id", entityColumn = "groupId")
|
||||
val feeds: MutableList<Feed>
|
||||
var feeds: MutableList<Feed>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user