在下面的示例中,FolderItem::class
属于value
的{{1}}属性,即使未明确说明:
Junction
它的编译和运行与我写出来的相同:
class FolderWithItems(
@Embedded
val folder: Folder,
@Relation(
associateBy = Junction(
FolderItem::class,
parentColumn = "folder_id",
entityColumn = "item_id"
),
parentColumn = "id",
entityColumn = "id"
)
val items: List<Item>
)
什么是Kotlin原则/规则/语言功能,使您在这种情况下不必指定value = FolderItem::class
?