Reputation: 345
Is it possible to exclude a child of a field? e.g. A field "item" contains another "subItem". How can I exlude the "subItem" being mapped?
<mapping>
<class-a>test.ClassA</class-a>
<class-b>test.ClassB</class-b>
<field-exclude>
<a>item.subItem</a>
<b>item.subItem</b>
</field-exclude>
</mapping>
Thanks for any sugestions.
Upvotes: 1
Views: 1876
Reputation: 31
Unfortunately no, but there is a trick. You can define contextual mapping for your Item class:
<mapping>
<class-a>test.ClassA</class-a>
<class-b>test.ClassB</class-b>
<field map-id="itemExcludeSubitem">
<a>item</a>
<b>item</b>
</field>
</mapping>
<mapping map-id="itemExcludeSubitem">
<class-a>test.ItemA</class-a>
<class-b>test.ItemB</class-b>
<field-exclude>
<a>subItem</a>
<b>subItem</b>
</field-exclude>
</mapping>
Upvotes: 3