一路拾遺
Collect By Finding All The Way ......
BlogJava
首頁
新隨筆
新文章
聯系
聚合
管理
posts - 81,comments - 41,trackbacks - 0
<
2009年7月
>
日
一
二
三
四
五
六
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
我的博客開張啦!歡迎大家多多來踩!
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(5)
給我留言
查看公開留言
查看私人留言
隨筆檔案
2010年9月 (1)
2010年6月 (2)
2010年5月 (5)
2009年12月 (4)
2009年11月 (3)
2009年10月 (2)
2009年8月 (2)
2009年7月 (4)
2009年6月 (5)
2009年5月 (1)
2009年4月 (2)
2008年12月 (2)
2008年11月 (1)
2008年10月 (1)
2008年9月 (4)
2008年8月 (12)
2008年7月 (30)
文章檔案
2008年12月 (1)
相冊
畢業照
搜索
積分與排名
積分 - 64548
排名 - 824
最新評論
1.?re: myeclipse開發hibernate應用程序示例[未登錄]
真的好好...
--云
2.?re: myeclipse開發hibernate應用程序示例
做得很認真,頂一個
--~!
3.?re: myeclipse開發hibernate應用程序示例[未登錄]
not bad
--1
4.?re: myeclipse開發hibernate應用程序示例
類名一定要大寫,hibernate版本要小于4才行!!!!!!
--第三方
5.?re: myeclipse開發hibernate應用程序示例
有錯誤啊
--第三方
閱讀排行榜
1.?myeclipse開發hibernate應用程序示例(15650)
2.?使用AXIS調用WSDL描述的Web服務(9686)
3.?使用AXIS調用WSDL描述的Web服務(續)(6046)
4.?基于RemoteObject方式的Java-Flex交互(USING LCDS)(2680)
5.?Java WebService注冊中心JUDDI配置方法(2200)
評論排行榜
1.?myeclipse開發hibernate應用程序示例(16)
2.?使用UDDI4J連接JUDDI(10)
3.?使用AXIS調用WSDL描述的Web服務(續)(5)
4.?使用AXIS調用WSDL描述的Web服務(3)
5.?找實習的傷心事(2)
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 2009-07-13 10:46
胖胖泡泡
閱讀(322)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Copyright ©2025 胖胖泡泡 Powered By
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
灵寿县
|
读书
|
横峰县
|
肥西县
|
鄂托克前旗
|
彭阳县
|
青海省
|
莎车县
|
墨脱县
|
江永县
|
淮南市
|
东城区
|
凤凰县
|
唐山市
|
于都县
|
东丰县
|
贵德县
|
开鲁县
|
辰溪县
|
曲麻莱县
|
贵溪市
|
祁东县
|
黄陵县
|
高碑店市
|
余姚市
|
商丘市
|
中牟县
|
祁东县
|
南江县
|
普安县
|
武胜县
|
遵义市
|
韶山市
|
瑞昌市
|
寻乌县
|
平泉县
|
武胜县
|
柘荣县
|
兰坪
|
剑阁县
|
普陀区
|