首页 > 其他 > 详细

hybris items.xml 中表的联合主键实现

时间:2017-05-19 11:41:46      阅读:343      评论:0      收藏:0      [点我收藏+]

在 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 中表的联合主键实现

原文:http://www.cnblogs.com/wahaha603/p/6877498.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!