Liferay service.xml外键多对多

时间:2012-11-19 20:16:56

标签: service entity liferay builder

Hello Liferay专家,

请帮我在Liferay中为以下场景创建service.xml

我有2张桌子

  1. SystemUsed

    systemUsedId long
    name varchar
    
  2. User_SystemUsed

    userId long        --> mapped to userId of User_ table
    systemUsedId long  --> mapped to  systemUsedId of SystemUsed table.<br>
    
  3. 由于

1 个答案:

答案 0 :(得分:1)

您可以按如下方式创建表格:

<entity name="SystemUsed" local-service="true" remote-service="false"> 
    <column name="systemUsedId type="Long" />
    <column name="name" type="String"/>
</entity>
<entity name="User_SystemUsed" local-service="true" remote-service="false">  
    <column name="systemUsedId" type="SystemUsed" entity="SystemUsed" mapping-key="systemUsedId" />  
    <column name="userId" type="User" entity="User_" mapping-key="userid" />  
</entity>

我希望user_ table的映射正确...