推土机映射列表

时间:2015-08-03 13:09:55

标签: dozer

我的源类:

com.first
public class Region {

@XmlElement(required = true)
protected String id;
protected String href;
@XmlElement(required = true)
protected String name;
protected String url;
protected String maxLatitude;
protected String minLatitude;
protected String maxLongitude;
protected String minLongitude;
protected List<Facility> facility;

目的地类:

com.second
public class Region {

@XmlElement(required = true)
protected String id;
protected String href;
@XmlElement(required = true)
protected String name;
protected String url;
protected String maxLatitude;
protected String minLatitude;
protected String maxLongitude;
protected String minLongitude;
protected List<Facility> facility;

Dozzer bean映射:

 <mapping map-id="fr">
        <class-a>com.first.Region</class-a>
        <class-b>com.second.Region</class-b>
        <field>
           <a>facility</a>
           <b>facility</b>
           <b-hint>org.second.Region</b-hint>
        </field>
</mapping>

使用上述配置,我能够映射除facility之外的所有元素 有人可以告诉我如何映射设施(这是一个列表)

1 个答案:

答案 0 :(得分:0)

你的提示有org.second,不应该是com.second吗?