我使用推土機來執行對象映射。一切工作都很好,只是我無法映射這個特定的東西。推土機:將字段映射到函數輸出
<mapping>
<class-a>User</class-a>
<class-b>UAUserBean</class-b>
<field>
<a>RightLst.Right</a>
<b>Rights</b>
<a-hint>Right</a-hint>
<b-hint>UARightBean</b-hint>
</field>
<field>
<a>RightLst.NumInLst</a>
<b>Rights.length</b>
</field>
</mapping>
//here RightLst is an object of a class and numInLst (int prop)
//rights is an array of objects
我想要做的是
lUser.getRightLst().setNumInLst(uaUserBean.getRights().length);
任何建議?
在此先感謝。
User{
protected RightLst rightLst;
}
RightLst{
protected Integer numInLst;
protected Collection right = new ArrayList();
}
public class UAUserBean{
private UARightBean[] rights;
}
讓我們看看你的類是什麼樣的。 – davidmontoyago 2012-08-07 14:12:51
剛剛編輯帖子以顯示課程。這是不詳細,否則它會太長.. – Afaque 2012-08-07 14:50:56