hybris items.xml 中表的聯合主鍵實現
在 items.xsd中是這麽定義 unique的
<xs:attribute name="unique" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>If ‘true‘, the value of this attribute has to be unique within all instances of this type. If there are multiple attributes marked as unique,
then their combined values must be unique. Will not be evaluated at jalo layer, if you want to manage the attribute directly using jalo layer you have to ensure uniqueness manually. Default is ‘false‘.
</xs:documentation>
</xs:annotation>
</xs:attribute>
也就是說 聯合主鍵可以通過 unique指定多個字段來達到要求。具體設置如下
<itemtype code="xxx" autocreate="true" generate="true" jaloclass="com.xxx.core.jalo.OrgSalesUnit">
<deployment table="xxx" typecode="30001" />
<attributes>
<attribute qualifier="code1" type="String" generate="true">
<persistence type="property"></persistence>
<modifiers read="true" write="true" search="true" optional="false" unique="true"
</attribute>
<attribute qualifier="code2" type="String">
<modifiers read="true" write="true" search="true" optional="false" unique="true" />
<persistence type="property" />
</attribute>
</itemtype>
hybris items.xml 中表的聯合主鍵實現