浪跡天涯
          web報表設(shè)計器....
          posts - 61,comments - 71,trackbacks - 0
          <2007年8月>
          2930311234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          常用鏈接

          留言簿(9)

          隨筆分類(64)

          隨筆檔案(61)

          相冊

          友情聯(lián)接

          最新隨筆

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          ???? /**
          ???? * 根據(jù)頁碼取出當(dāng)前頁面的記錄
          ???? * @param stratCount 起始記錄號
          ???? * @param maxCount 取出記錄個數(shù)
          ???? * @param sql 查詢條件
          ???? * @return 包含Testcode對象的List
          ???? */?????
          ?public?List?getTestcodeList(int?startCount,?int?Count,?String?whereSQL)?{
          ????????????
          //?startCount?起始記錄
          ????????????
          //?count顯示記錄的個數(shù)
          ????????????String?sqls?=?"select?{t.*}?from?Testcode?t?"+whereSQL;
          ????????????SQLQuery?query?
          =?getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sqls);
          ????????????query.addEntity(
          "t",Testcode.class);
          ????????????query.setFirstResult(startCount);
          ????????????query.setMaxResults(count);
          ????????????List?topList?
          =?query.list();
          ????????????
          return?topList;
          ????}


          ???? /**
          ???? * 計算記錄的總數(shù)
          ???? * @param sql 查詢條件
          ???? * @return 總數(shù)
          ???? */
          ?????public?int?getTestcodeCount(String?whereSQL)?{
          ????????????
          //?TODO?Auto-generated?method?stub
          ????????????int?count=0;
          ????????????String?sqls?
          =?"select?count(*)?as?countRow?from?Testcode?t?"+whereSQL;
          ????????????SQLQuery?query?
          =?getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sqls);
          ????????????query.addScalar(
          "countRow",?Hibernate.INTEGER);
          ????????????List?topList?
          =?query.list();
          ????????????
          if?(topList.get(0)?!=?null)
          ???????????????count?
          =?(Integer)?topList.get(0);
          ????????????
          return?count;
          ????}
          posted on 2007-08-09 18:33 JJCEA 閱讀(2511) 評論(0)  編輯  收藏 所屬分類: java日記
          主站蜘蛛池模板: 宝坻区| 新巴尔虎左旗| 婺源县| 曲松县| 砀山县| 蒙自县| 郸城县| 内黄县| 大方县| 来安县| 兴仁县| 渭源县| 兴安盟| 德保县| 金阳县| 蓝田县| 柳林县| 滁州市| 淳安县| 青冈县| 凤阳县| 玉田县| 旌德县| 黄浦区| 凤翔县| 商城县| 嘉荫县| 黄平县| 泌阳县| 延寿县| 大理市| 桂东县| 任丘市| 麻栗坡县| 汉川市| 柯坪县| 丘北县| 高雄县| 济源市| 贞丰县| 兰州市|