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

Posted wahaha603

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 中表的联合主键实现的主要内容,如果未能解决你的问题,请参考以下文章

如何本地化在 Hybris 的 trainingcore-items.xml 中创建的自定义类型?

属性的修饰符不会影响 items.xml 中的数据库,这是为啥呢?

SAP Hybris 无法创建自定义横幅组件

SAP Hybris电商系统与阿里云联合测试系列十读写分离

当我在 Hybris 中本地化枚举类型时,如何解决 java.lang.IllegalStateException?

如何更改 SQLDelight 中表的主键?