I try to ignore a field when using the @Parcelize annotation in Kotlin so I am using @IgnoredOnParcel,
Plz guide me, on how to solve this error
error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
private final com.boltuix.mvvm.model.Source source = null;
^
Here is my full source code: https://github.com/BoltUIX/REST-APIs-with-Retrofit-and-MVVM-architecture.
Now i have a plan to recreate the data class, is there any better solution to ignore fields
@Entity(tableName = "favorite_movie")
@Parcelize
data class Article(
val author: String?,
val content: String?,
val description: String?,
val publishedAt: String?,
val pagedLists: Source,
val title: String?,
val url: String?,
val urlToImage: String?
): Parcelable {
@PrimaryKey(autoGenerate = true)
var id : Int = 0
@IgnoredOnParcel
var pagedList: Source = pagedLists
}
@IgnoredOnParcel annotation doesn't work for @Parcelize in Kotlin
............................. To ignore for Room, then you need to use Room's @Ignore annotation is not working for me
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).
public final class Article implements android.os.Parcelable {..
@Entity(tableName = "favorite_movie")
@Parcelize
data class Article(
val author: String?,
val content: String?,
val description: String?,
val publishedAt: String?,
@Ignore val pagedLists: Source,
val title: String?,
val url: String?,
val urlToImage: String?
): Parcelable {
@PrimaryKey(autoGenerate = true)
var id : Int = 0
}