如何把Hibernate查詢出的Object[]List放在ExtremeComponents顯示
Object[] 中含有兩個Class,
Query query=sess.createQuery("from Parts as a,Partsdetail as b where a.kind='G' and a.partno=b.partno ");
----------------------------------------------------------------
List v=query.list();
List li=new ArrayList();
for(int i=0;i<v.size();i++)
{
Map ma=new HashMap();
Object[] o=(Object[])(v.get(i));
{
ma.put("partno", ((com.gecs.steel.Parts)o[0]).getPartno());
ma.put("descr",((com.gecs.steel.Parts)o[0]).getDescr());
ma.put("value",((com.gecs.steel.Parts)o[0]).getValue());
ma.put("kind",((com.gecs.steel.Parts)o[0]).getKind());
}
{
ma.put("vendorno", ((com.gecs.steel.Partsdetail)o[1]).getVendorno());
ma.put("bodymark", ((com.gecs.steel.Partsdetail)o[1]).getBodymark());
}
li.add(ma);
}
sess.close();
----------------------------------------------------------------------
<ec:row onmouseover="this.style.cursor='hand'">
<ec:column property="partno" title="PNL"></ec:column>
</ec:row>
-----------------------------------------------------------------------
就OK了,不知還有更好的方法沒有?