KK

          Kim-'s-Blog.Object-Everything.I'm POJO.

          .紀-錄.爲了忘卻的記憶..真的勇士,要敢于直面遇到的問題,敢于正視繁雜的原碼......在實踐中積累!

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            74 Posts :: 1 Stories :: 70 Comments :: 0 Trackbacks
          如何把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了,不知還有更好的方法沒有?
          posted on 2006-12-04 11:56 Kim' 閱讀(265) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          jj
          主站蜘蛛池模板: 若尔盖县| 长葛市| 江达县| 永定县| 马山县| 澄江县| 潮州市| 靖安县| 务川| 毕节市| 德兴市| 伊通| 鹤壁市| 长岭县| 临湘市| 合肥市| 共和县| 东台市| 普格县| 乐清市| 永丰县| 惠水县| 共和县| 广德县| 潞城市| 竹山县| 林州市| 重庆市| 玉龙| 商南县| 正宁县| 仲巴县| 秀山| 云南省| 武隆县| 浮梁县| 车险| 云安县| 祁东县| 灵寿县| 江津市|