我有一个要求,我employee在ABC存储库和存储库address_details中有两个表XYZ。
的一列employee具有对 的外键引用address_details。
在这里,我有primaryKeyforaddress_details并且使用该primaryKey
引用我必须将我的数据插入到employee.
所以我的 RDF 是这样的:
RDF 1: (Repository1 : ABC)
<item-descriptor name=”employee” >
<table name=”employee”>
<property name=”empId” data-type=”string” column-name=”emp_id”
required=”true”/>
<property name=”address” column-name=”address_id” item-type=”address”
repository=”XYZ” required=”true”/>
</table>
</item-descriptor>
RDF 2: (Repsitory2 : XYZ)
<item-descriptor name=”address” >
<table name=”address_details”>
<property name=”addressId” data-type=”string” column-name=”address_id”/>
<property name=”streetName” column-name=”street_name” data-type=”string”/>
<property name=”city” column-name=”city” data-type=”string” />
</table>
</item-descriptor>
我将所有地址都存储在 table 中address_details。我必须映射employee到这些地址。
我在这里尝试的方法是先获取RepostoryItemof Address
,然后设置属性类型address并将employee其添加到employee表中。这行得通。
但是我想employee单独在一个调用中插入数据?
关于如何使用RepositoryItemor
来做到这一点的任何建议MutableRepositoryItem?