If we want the relatioship is TestParent.testNo = TestChild.testNo, do not use the identity column "id".
We should specify the columns in mapping file, such as:
<key property-ref="columnName"> is for Parent object
<column name="columnName"> is for Child object
If do not specify the property-ref, the sql would be:
this.ID = this.child.columnName.
If specify the property-ref, the sql would be:
this.columnName = this.child.columnName
本文介绍了如何正确配置对象关系映射(ORM),确保父类与子类之间的关系正确建立。通过指定属性引用而非使用默认标识符,可以实现更精确的数据关联。
1035

被折叠的 条评论
为什么被折叠?



