现在假设你有一个这样的数据库结构:
表对象
{
id,
name
}
表对象关系
{
id,
parentID, -- points to id in the object table
childID -- points to id in the object table
}
我想在我的模型中包含以下内容:
{
property name
property children
property parent
}
在这种情况下,你们将如何定义父属性?请记住,根元素显然没有父对象。