2017-02-06 6 views
1

문서 ID 참조가 포함 된 impex에 문제점이 있습니다.문서 ID 참조가 임팩트를 위해 작동하지 않음

From docs : "특히 partOf 항목 값을 가져 오는 경우 partOf 항목은 종종 고유 키를 제공하지 않고 외래 키로 만 해당 부모를 보유하기 때문에 일반적인 항목 기술을 사용하여 이러한 항목을 참조해야합니다 . " * items.xml (만 가장 중요한 부분)에서

항목

<itemtype code="A" autocreate="true" generate="true" abstract="true"/> 

<itemtype code="B" autocreate="true" generate="true" extends="A"> 
    <deployment table="btable" typecode="20115" /> 
    <attributes> 
     <attribute qualifier="code" type="java.lang.Integer" autocreate="true" generate="true"> 
     <persistence type="property"/> 
     <modifiers optional="false"/> 
    </attribute> 
</attributes> 
</itemtype> 

<itemtype code="C" autocreate="true" generate="true"> 
    <deployment table="ctable" typecode="20117" /> 
    <attributes> 
     <attribute qualifier="code" type="java.lang.String" autocreate="true" generate="true"> 
      <persistence type="property"/> 
      <modifiers optional="false" unique="true"/> 
     </attribute> 
     <attribute qualifier="test" type="A" autocreate="true" generate="true"> 
      <persistence type="property"/> 
      <modifiers optional="false" partof="true"/> 
     </attribute> 
    </attributes> 
</itemtype> 

의 Impex 코드 :

INSERT B;code;&docIdRef 
;1;docId 

INSERT_UPDATE C;code[unique=true];test(&docIdRef) 
;uniqueCode;docId 

오류 메시지 : 내가 '공범자'를 제거

cannot create C with values ItemAttributeMap[ registry: null, type: <null>, (...) due to [de.hybris.plat[email protected]3b777877]:missing values for [test] in model C 

수정 자 'test'속성 (C 클래스)에서 모든 것이 정상적으로 작동했습니다.

'partof'한정자를 유지하려는 경우 임팩트가 어떻게 나타나야하는지 궁금합니다.

답변

0

데이터가 올바른지 확인하는 경우 [forceWrite = true] 한정자 또는 레거시 모드를 사용하여 서비스 계층 유효성 검사를 건너 뛸 수 있습니다.

또한이 구성이 실제로 필요한 것인지 확인해야합니다. 선택적 true 또는 partOf를 false로 설정하거나 기본값을 제공하면 문제가 해결됩니다.

0

partof="true"을 언급 했으므로 A 유형의 참조를 할당 할 수 없습니다. 새 항목 만 만들 수 있습니다.

확인 OOTB AbstractOrder2AbstractOrderEntry 관계는, 그들은 AbstractOrderEntry에 대한 partof="true" 당신이 Order에 다른 AbstractOrderEntry을 참조 할 수 있음을 의미 언급했다. 언제든지 새 항목을 만들 수 있습니다.

은 HMC 사이트에서보기뿐만 아니라

enter image description here

당신은 여기에서 볼 수 있습니다 여기에 사용 가능한 + Add Entry 버튼이없는 되세요. 역수적 일 수 있습니다.

0

partOf을 사용하는 경우 소유자를 사용하여 partOf을 참조해야합니다.

는 그래서 수행합니다

INSERT B;owner(C.code);&docIdRef 
;uniqueCode;docId 

INSERT_UPDATE C;code[unique=true];test(&docIdRef) 
;uniqueCode;docId 

당신은 B에게 식별자를 할당 할 필요가 없습니다, 당신은 단지 소유자를 참조 할 필요가있다.