Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error!!
- e: error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- @Entity(tableName = "NewsEntity")
- class NewsEntity(
- @PrimaryKey
- var id: String = "",
- var title: String = "",
- var link: String = "",
- var description: String = "",
- var favourite: Boolean = false) {
- constructor() : this("", "", "", "", false)
- @Ignore
- constructor(model: NewsItem) : this() {
- title = model.title
- link = model.link
- description = model.description
- id = "${model.title}${model.link}"
- }
- companion object {
- const val ID = "id"
- const val TITLE = "title"
- const val LINK = "link"
- const val DESCRIPTION = "description"
- const val FAVOURITE = "favourite"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement