package petbox.ae.Class
import androidx.room.Entity import androidx.room.PrimaryKey
@Entity(tableName = "products")
data class PostModel(
@PrimaryKey val id : Int? = null,
val images: ArrayList<Data>,
val name: String,
val description: String,
val price: Double?=null )
data class Data(
val id: Int,
val date_created: String,
val date_created_gmt: String,
val date_modified: String,
val src: String, )
and the error i am getting is:
error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
private final java.util.ArrayList<petbox.ae.Class.Data> images = null;
error: Type of the parameter must be a class annotated with @Entity or a collection/array of it.
retrofit2.Call<java.util.List<petbox.ae.Class.PostModel>> product, @org.jetbrains.annotations.NotNull()
error: Cannot figure out how to read this field from a cursor.
private final java.util.ArrayList<petbox.ae.Class.Data> images = null;
how to make it read it ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…