package com.ys.bdtp.adm.mvvm.model.db.relation

import androidx.room.Embedded
import androidx.room.Relation
import com.ys.bdtp.adm.mvvm.model.db.entity.task.BuildingEntity
import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProjectEntity

/**
 * 嵌套关系
 *  Project 与 Building 一对多
 *  Building 与 Floor 一对多
 */
data class ProjectWithBuildingAndFloors(
    @Embedded val project: ProjectEntity,
    @Relation(
        entity = BuildingEntity::class,
        parentColumn = "id",
        entityColumn = "project_id"
    )
    val buildings: List<BuildingWithFloors>
)
