Menu

#359 cant use multiple map-id at the same time

Dozer v5.3.2
open
nobody
5
2011-11-23
2011-11-23
tih pih
No

I have a big and flat object (from mainframe) called fr.tihpih.dozer.vo.RecordDogs. I want to map this object to a fr.tihpih.dozer.vo.Dogs containing 2 differents Dogs (dog1 and dog2). Each dog (of class fr.tihpih.dozer.vo.Dog) must use a special mapping specified by map-id.

<mapping wildcard="true">
<class-a>fr.tihpih.dozer.vo.RecordDogs/class-a>
<class-b>fr.tihpih.dozer.vo.Dogs</class-b>

<field map-id="mapdog1">
<a>this</a>
<b>dog1</b>
</field>
<field map-id="mapdog2">
<a>this</a>
<b>dog2</b>
</field>
</mapping>

<mapping wildcard="true" map-id="mapdog1">
<class-a>fr.tihpih.dozer.vo.RecordDogs</class-a>
<class-b>fr.tihpih.dozer.vo.Dog</class-b>
<field>
<a>dog_field_source_A</a>
<b>dog_field_dest</b>
</field>
</mapping>

<mapping wildcard="true" map-id="mapdog2">
<class-a>fr.tihpih.dozer.vo.RecordDogs</class-a>
<class-b>fr.tihpih.dozer.vo.Dog</class-b>
<field>
<a>dog_field_source_B</a>
<b>dog_field_dest</b>
</field>
</mapping>

BUT only the first declared map-id is used for mapping from RecordDogs to Dog: mapdog1. The 2 dogs (dog1 and dog2) are mapped with this map-id.

dog2 has dog_field_source_A value instead of dog_field_source_B !!!

Is this a bug ?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB