CymChad / BaseRecyclerViewAdapterHelper

BRVAH:Powerful and flexible RecyclerAdapter
http://www.recyclerview.org/
MIT License
24.2k stars 5.14k forks source link

继承了BaseExpandNode,无法重写isExpanded, #3792

Closed sceneren closed 6 months ago

sceneren commented 11 months ago

因为我使用了room,定义了一个嵌套关系,所有无法在结果的实体类里去忽略isExpaned字段,导致room编译不过

    @Embedded val departDBInfo: DepartDBInfo,

    @Relation(parentColumn = "id", entityColumn = "parentId")
    val child: MutableList<DepartDBInfo>,
) : BaseExpandNode() {

    @Ignore
    override var childNode: MutableList<BaseNode> = mutableListOf<BaseNode>()

    fun getItemType(): Int {
        return departDBInfo.type
    }

}

编译报错 Non-existent columns are specified to be ignored in ignoreColumns: isExpanded public final class DepartDBInfo

chenfuxu920 commented 10 months ago

在实体类中添加 @Entity(ignoredColumns = ["isExpand"])