我将信息上传到Book类。
uploadFileDetails
书有一个章节Chapter
tableName = "Books_name" data class Books( // @Embedded // val additional_imgs: MutableList<String>, val adult: Int, val author: String, val bookmark: Int, val chapters: MutableList<Chapter>? = null, val chapters_total: Int, // @Embedded // val comments: MutableList<Comment>, 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 )
但是添加此类后,会出现错误。我一直在寻找信息,但是到处都有他们说通过清理项目可以纠正此问题。但这无济于事。错误:
实体和Pojos必须具有可用的公共构造函数。你可以有 一个空的构造函数或参数与之匹配的构造函数 字段(按名称和类型)。 -java.util.List