2016-08-27 6 views
1

items.xml内にタイプHybrisEnumValueの属性を持つ新しいitemtypeを宣言しようとしているユースケースがあります。 しかし、私がAntビルドをしようとすると、この属性のビルドエラーが発生します.HybrisEnumValueタイプが見つからないためにエラーが発生します。Hybrisのitems.xmlで "HybrisEnumValue"タイプの属性を宣言するにはどうすればいいですか?

これは私のitems.xmlにエントリです:

<itemtype code="xyz" generate="true" autocreate="true"> 
     <deployment table="xyz" typecode="1"/> 
     <attributes> 
      <attribute type="HybrisEnumValue" qualifier="def"> 
       <persistence type="property"/> 
       <modifiers read="true" write="true" search="true" optional="true" /> 
      </attribute> 

     </attributes> 
    </itemtype> 

答えて

1

HybrisEnumValueは、その実際の種類、あなたがオブジェクト型としてitems.xmlにして定義することはできませんインタフェースではありません。

モデルでenumValueを定義するには、まずenumtypeタグを使用して列挙値を定義する必要があります。

<enumtype generate="true" code="ColorEnum" autocreate="true" 
     dynamic="true"> 
     <value code="BLACK" /> 
     <value code="BLUE" /> 
     <value code="BROWN" /> 
     <value code="GREEN" /> 
</enumtype> 

enumTypeを動的にするかどうかを選択します。動的なことは、実行時にも値を追加できることを意味します。 あなたのitemTypeの上にenumTypeを定義してください。

ここでチェックEnumType

今すぐすべてのantを実行してください。..このようなあなたのモデルに

<itemtype code="xyz" generate="true" autocreate="true"> 
    <deployment table="xyz" typecode="1"/> 
    <attributes> 
     <attribute type="ColorEnum" qualifier="color"> 
      <persistence type="property"/> 
      <modifiers read="true" write="true" search="true" optional="true" /> 
     </attribute> 

    </attributes> 
</itemtype> 

をごenumTypeを定義し、それが実際にimplements HybrisEnumValue ColorEnum.javaを生成します。

+0

Hi Shreshtt。ご回答有難うございます。実際には、すでにいくつかの共通の属性を持つ2つの異なる列挙型があります。クラスでは、私はこれらの誰かにアクセスしたいです。だから両方の列挙の親である単一の属性を定義しようとしました。 – AppleBud

関連する問題