我对 xml 推土机映射有疑问,要么它不支持这种深度映射,要么我做错了什么。来源是:
Public Class ABean{
private List<AABean> aa;
}
Public Class AABean{
private List<BBean> b;
}
Public Class BBean{
private List<String> c;
}
目的地是:
Public Class A{
private List<AA> aa;
}
Public Class AA{
private List<B> b;
}
Public Class B{
private List<String> c;
}
映射是:
<mappings xmlns="http://dozer.sourceforge.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://dozer.sourceforge.net
http://dozer.sourceforge.net/schema/beanmapping.xsd">
<mapping type="one-way" date-format="MM/dd/yyyy" stop-on-errors="false" map-null="false" map-empty-string="false">
<class-a>sourcePackage.ABean</class-a>
<class-b>disPackage.A</class-b>
<field>
<a>aa</a>
<b>aa</b>
<a-hint>sourcePackage.AABean</a-hint>
<b-hint>disPackage.AA</b-hint>
</field>
<field>
<a>aa</a>
<b>aa</b>
<a-hint>sourcePackage.aa</a-hint>
<b-hint>disPackage.aa</b-hint>
</field>
</mapping>
<mapping type="one-way" date-format="MM/dd/yyyy" stop-on-errors="true" map-null="false" map-empty-string="false">
<class-a>sourcePackage.aa</class-a>
<class-b>disPackage.aa</class-b>
<field>
<a>b</a>
<b>b</b>
<a-hint>sourcePackage.BBean</a-hint>
<b-hint>disPackage.B</b-hint>
</field>
</mapping>
<mapping type="one-way" date-format="MM/dd/yyyy" stop-on-errors="true" map-null="false" map-empty-string="false">
<class-a>sourcePackage.BBean</class-a>
<class-b>disPackage.B</class-b>
<field>
<a>c</a>
<b>c</b>
</field>
</mapping>
</mappings>
bean 列表 AABean 有一个值,但映射后 AA 为空,我尝试通过在第一个映射中使用点来深入映射但也没有用,请任何人都可以帮助我