我正在尝试在 3 个表之间创建关系。以下是表格:
- 房间
- 设施
- 设施映射
房间表包含
- 房间号
- 房间名
设施表包含
- 设施 ID
- 设备名称
设施映射表包含
- 设施 ID
- 房间号
- 设施数量
在facilityMapping 表中,我想创建对以上两个表的引用。
在 service.xml 我试图创建参考
<service-builder package-path="com.admin.services">
<namespace>rbms</namespace>
<entity name="rooms" local-service="true" remote-service="false">
<column name="roomId" type="int" primary="true"></column>
<column name="roomName" type="String"></column>
<column name="roomFloorNo" type="int"></column>
<column name="roomLocationName" type="String"></column>
<column name="roomCapacity" type="int"></column>
<column name="roomImages" type="String"></column>
</entity>
<entity name="facilities" local-service="true" remote-service="false">
<column name="facilityId" type="int" primary="true"></column>
<column name="facilityName" type="String"></column>
<!--
|- Finding Equipments using their Names and display it in form
|- It will help you to add new Room.
-->
<finder name="facilityName" return-type="Collection">
<finder-column name="facilityName"></finder-column>
</finder>
</entity>
<entity name="facilityMapping" remote-service="false" local-service="true">
<column name="facilityId" type="int"></column>
<column name="roomId" type="int"></column>
<column name="facilityQuantity" type="int"></column>
<column name="fk_fid" type="Collection" entity="com.admin.services.facilities" mapping-key="facilityId"></column>
</entity>
</service-builder>
错误:必须为元素类型列声明映射键