I upload information to the Book class.
@Entity(tableName = "Books_name") data class Books( // @Embedded // val additional_imgs: MutableList<String>, val adult: Int, val author: String, val bookmark: Int, @Embedded @SerializedName("chapters") //@TypeConverters(StrTypeConverters::class) val chapters: MutableList<Chapter>, val chapters_total: Int, // @Embedded // val comments: MutableList<Comment>, @PrimaryKey(autoGenerate = true) val id: Int? = null, val img: String, val lang: String, val last_activity: Int, val n_chapters: Int, val publisher: String, val rating: String, val s_title: String, val status: String, val t_title: String, // val team: Int, val writer: String, val year: String )
Dao book
@Dao interface CurrentBooksDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun upset(weatherEntry: Books) @Query("select * from Books_name where id = :id") fun getBooksDao(id: Int): LiveData<ImperialCurrentBooksEntry> @Delete fun delete(employee: Books) }
Book has a class Chapter
@Entity(tableName = "List_Chapter_name", indices = [Index(value = ["id_glavsList"], unique = true)]) data class Chapter( val can_read: Boolean = false, @PrimaryKey(autoGenerate = true) val id_glavsList: Int? = null, val new: Boolean = false, val status_glavs: String = "", val title: String = "" )
But after adding this class, an error appears. I was looking for information, but everywhere they say that this is corrected by cleaning the project. But it does not help. Mistake
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). - java.util.List