<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    天空是藍色的

    做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
    數據加載中……
    修正一下Hibernate取count(*)的方法
        public int getCount(String emailGroupId, String emailBatchId)
                
    throws HibernateException {

            Session session 
    = HibernateUtil.currentSession();
            Transaction tx 
    = session.beginTransaction();

            String hql 
    = "select count(*) from EmailSendInfo where email_group_id = :emailGroupId and batch_id = :batchId";
            Query query 
    = session.createQuery(hql);

            query.setString(
    "emailGroupId", emailGroupId);
            query.setString(
    "batchId", emailBatchId);
            
    /*
             * for (Iterator it = query.iterate(); it.hasNext();) { return
             * ((Integer) it.next()).intValue(); }
             
    */

            
    try {
                
    return ((Integer) query.iterate().next()).intValue();
            }
     catch (Exception e) {
                
    throw new HibernateException("");
            }
     finally {
                tx.commit();
                HibernateUtil.closeSession();
            }

        }

    posted on 2005-12-22 14:20 bluesky 閱讀(3381) 評論(3)  編輯  收藏 所屬分類: 工作總結

    評論

    # re: 修正一下Hibernate取count(*)的方法 2007-01-11 11:18 漂泊

    很好,謝謝,找了半天了!
    終于可以了
      回復  更多評論    

    # re: 修正一下Hibernate取count(*)的方法 2007-09-14 14:32 XT

    為什么我這樣寫,它卻總是報
    return ((Integer) query.iterate().next()).intValue();
    這句話類型轉換錯誤呢?
      回復  更多評論    

    # re: 修正一下Hibernate取count(*)的方法[未登錄] 2007-09-18 22:33 bluesky

    是不是你的數量太大了,超過了Integer類型的范圍了,試下Long?
      回復  更多評論    
    主站蜘蛛池模板: 中国在线观看免费高清完整版| 国产vA免费精品高清在线观看 | 免费一级毛片女人图片| 香蕉大伊亚洲人在线观看| 久久久高清免费视频| 中文字幕亚洲综合小综合在线| 一个人在线观看视频免费 | 国产成人精品亚洲一区| 日韩成人免费在线| 小说区亚洲自拍另类| 少妇亚洲免费精品| 一级A毛片免费观看久久精品 | 亚洲伊人久久大香线蕉影院| 麻豆一区二区免费播放网站| 伊人久久亚洲综合影院首页| 国产成人免费网站在线观看| 人妻仑乱A级毛片免费看| 国内精品99亚洲免费高清| 国产成人免费视频| 亚洲欧洲精品久久| 国内精品免费视频自在线| 日韩亚洲综合精品国产| 亚洲性猛交XXXX| 99ee6热久久免费精品6| 亚洲人成77777在线播放网站不卡 亚洲人成77777在线观看网 | eeuss影院免费直达入口| 亚洲精品高清久久| 免费无码AV片在线观看软件| 香蕉视频免费在线| 亚洲VA中文字幕无码一二三区| 亚洲三级高清免费| 老司机午夜在线视频免费观| 国产AV无码专区亚洲Av| 九九精品免费视频| 一个人晚上在线观看的免费视频 | 免费人成在线观看网站品爱网日本| 一个人免费观看视频在线中文| 亚洲字幕在线观看| 亚洲成a人片在线观看久| 1000部羞羞禁止免费观看视频 | 亚洲AV无码一区二区一二区|