Hybris 重新声明关系
Hybris redeclare relation
我正在尝试在 Product2Componen
之间创建关系
<relation code="Product2Components" localized="false" autocreate="true">
<deployment table="ProdsCompRels" typecode="30008" />
<sourceElement qualifier="product" type="Product" cardinality="one" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="components" type="SimpleCMSComponent" cardinality="many">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
但是,hybris OOTB 已经在 product2ProductDetailComponent 中建立了关系:
<relation code="ProductDetailComponentsForProduct" generate="true" localized="false" autocreate="true">
<sourceElement qualifier="productDetailComponents" type="ProductDetailComponent" cardinality="many" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="product" type="Product" cardinality="one">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
当我编译它时 returns 我遇到了这个错误,因为这个已经存在的关系对我来说完全没用:
Attribute CmsLinkComponent.product(Product):((cms2))::YAttributeDescriptor[cms2-items.xml:190(RelationTypeTagListener)][JALO] duplicates inherited attribute SimpleCMSComponent.product(Product):((puigcore))::YAttributeDescriptor[puigcore-items.xml:488(RelationTypeTagListener)][JALO]. Remove it or specify it as redeclared
如何重新声明关系?或者我应该在这里做什么?
由于 OOTB ProductDetailComponent 扩展了 SimpleCMSComponent 并且您想使用 SimpleCMSComponent 所以我认为你可以简单地使用 OOTB 关系。
但是如果你真的想删除你自己的 attribute/relation 那么你必须提供不同于 "product" 的不同限定符,因为产品限定符已经在 OOTB 关系中使用 ProductDetailComponentsForProduct
,其中 ProductDetailComponent 是 SimpleCMSComponent 的子类型。
<relation code="Product2Components" localized="false" autocreate="true">
<deployment table="ProdsCompRels" typecode="30008" />
<sourceElement qualifier="productRef" type="Product" cardinality="one" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="components" type="SimpleCMSComponent" cardinality="many">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
我正在尝试在 Product2Componen
之间创建关系<relation code="Product2Components" localized="false" autocreate="true">
<deployment table="ProdsCompRels" typecode="30008" />
<sourceElement qualifier="product" type="Product" cardinality="one" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="components" type="SimpleCMSComponent" cardinality="many">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
但是,hybris OOTB 已经在 product2ProductDetailComponent 中建立了关系:
<relation code="ProductDetailComponentsForProduct" generate="true" localized="false" autocreate="true">
<sourceElement qualifier="productDetailComponents" type="ProductDetailComponent" cardinality="many" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="product" type="Product" cardinality="one">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>
当我编译它时 returns 我遇到了这个错误,因为这个已经存在的关系对我来说完全没用:
Attribute CmsLinkComponent.product(Product):((cms2))::YAttributeDescriptor[cms2-items.xml:190(RelationTypeTagListener)][JALO] duplicates inherited attribute SimpleCMSComponent.product(Product):((puigcore))::YAttributeDescriptor[puigcore-items.xml:488(RelationTypeTagListener)][JALO]. Remove it or specify it as redeclared
如何重新声明关系?或者我应该在这里做什么?
由于 OOTB ProductDetailComponent 扩展了 SimpleCMSComponent 并且您想使用 SimpleCMSComponent 所以我认为你可以简单地使用 OOTB 关系。
但是如果你真的想删除你自己的 attribute/relation 那么你必须提供不同于 "product" 的不同限定符,因为产品限定符已经在 OOTB 关系中使用 ProductDetailComponentsForProduct
,其中 ProductDetailComponent 是 SimpleCMSComponent 的子类型。
<relation code="Product2Components" localized="false" autocreate="true">
<deployment table="ProdsCompRels" typecode="30008" />
<sourceElement qualifier="productRef" type="Product" cardinality="one" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true" />
</sourceElement>
<targetElement qualifier="components" type="SimpleCMSComponent" cardinality="many">
<modifiers read="true" write="true" search="true" optional="true" />
</targetElement>
</relation>