隨筆:15 文章:206 評論:35 引用:0
fenglin
創(chuàng)新、創(chuàng)意、挑戰(zhàn)
C++博客
首頁
發(fā)新隨筆
發(fā)新文章
聯(lián)系
聚合
管理
Spring3_Hibernate&Spring聲明式事務(wù)的XML配置方法
beans.xml
<?
xml version
=
"
1.0
"
encoding
=
"
UTF-8
"
?>
<
beans xmlns
=
"
http://www.springframework.org/schema/beans
"
xmlns:xsi
=
"
http://www.w3.org/2001/XMLSchema-instance
"
xmlns:context
=
"
http://www.springframework.org/schema/context
"
xmlns:aop
=
"
http://www.springframework.org/schema/aop
"
xmlns:tx
=
"
http://www.springframework.org/schema/tx
"
xsi:schemaLocation
=
"
http:
//
www.springframework.org/schema/beans
http:
//
www.springframework.org/schema/beans/spring-beans-3.0.xsd
http:
//
www.springframework.org/schema/context
http:
//
www.springframework.org/schema/context/spring-context-3.0.xsd
http:
//
www.springframework.org/schema/aop
http:
//
www.springframework.org/schema/aop/spring-aop-3.0.xsd
http:
//
www.springframework.org/schema/tx
http:
//
www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!--
a service object; we will be profiling its methods
-->
<
context:annotation
-
config
/>
<
context:component
-
scan base
-
package
=
"
com.bebig
"
/>
<
bean id
=
"
dataSource
"
class
=
"
org.apache.commons.dbcp.BasicDataSource
"
destroy
-
method
=
"
close
"
>
<
property name
=
"
driverClassName
"
value
=
"
${jdbc.driverClassName}
"
/>
<
property name
=
"
url
"
value
=
"
${jdbc.url}
"
/>
<
property name
=
"
username
"
value
=
"
${jdbc.username}
"
/>
<
property name
=
"
password
"
value
=
"
${jdbc.password}
"
/>
</
bean
>
<
context:property
-
placeholder location
=
"
classpath:jdbc.properties
"
/>
<
bean id
=
"
sessionFactory
"
class
=
"
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
"
>
<
property name
=
"
dataSource
"
ref
=
"
dataSource
"
/>
<!--
<
property name
=
"
annotatedClasses
"
>-->
<!--
<
list
>-->
<!--
<
value
>
com.bebig.model.User
</
value
>-->
<!--
<
value
>
com.bebig.model.Log
</
value
>-->
<!--
</
list
>-->
<!--
</
property
>-->
<
property name
=
"
packagesToScan
"
>
<
list
>
<
value
>
com.bebig.model
</
value
>
</
list
>
</
property
>
<
property name
=
"
hibernateProperties
"
>
<
props
>
<
prop key
=
"
hibernate.dialect
"
>
org.hibernate.dialect.SQLServerDialect
</
prop
>
<
prop key
=
"
hibernate.show_sql
"
>
true
</
prop
>
<
prop key
=
"
hibernate.format_sql
"
>
true
</
prop
>
<
prop key
=
"
hibernate.hbm2ddl.auto
"
>
update
</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean id
=
"
transactionManager
"
class
=
"
org.springframework.orm.hibernate3.HibernateTransactionManager
"
>
<
property name
=
"
sessionFactory
"
ref
=
"
sessionFactory
"
/>
</
bean
>
<!--
聲明式事務(wù)XML配置方法
-->
<
aop:config
>
<
aop:pointcut expression
=
"
execution(public * com.bebig.service..*.*(..))
"
id
=
"
servicePointcut
"
/>
<
aop:advisor advice
-
ref
=
"
txAdvisor
"
pointcut
-
ref
=
"
servicePointcut
"
/>
</
aop:config
>
<
tx:advice id
=
"
txAdvisor
"
transaction
-
manager
=
"
transactionManager
"
>
<
tx:attributes
>
<
tx:method name
=
"
getUser
"
read
-
only
=
"
true
"
/>
<
tx:method name
=
"
add*
"
propagation
=
"
REQUIRED
"
/>
</
tx:attributes
>
</
tx:advice
>
</
beans
>
發(fā)表于 2010-10-20 14:23
風(fēng)林
閱讀(470)
評論(0)
編輯
收藏
引用
所屬分類:
JAVA
、
Hibernate
、
Spring
只有注冊用戶
登錄
后才能發(fā)表評論。
【推薦】100%開源!大型工業(yè)跨平臺軟件C++源碼提供,建模,組態(tài)!
相關(guān)文章:
[轉(zhuǎn)]java編程中'為了性能'一些盡量做到的地方
JAVAC命令行錯誤
Java基礎(chǔ)_Collection接口下的子類存儲特性
Android_常用控件使用
Android_Activity&Intent&Layout
Integer自動裝箱、拆箱問題
自定義比較器、排序
JDBC操作實例
常用數(shù)據(jù)庫的JDBC連接代碼
[轉(zhuǎn)]J2SE_內(nèi)部類
網(wǎng)站導(dǎo)航:
博客園
IT新聞
BlogJava
博問
Chat2DB
管理
CALENDER
<
2025年7月
>
日
一
二
三
四
五
六
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
9
常用鏈接
我的隨筆
我的評論
我參與的隨筆
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
jBPM
(rss)
隨筆檔案
2011年7月 (1)
2011年4月 (1)
2011年2月 (1)
2010年11月 (1)
2010年10月 (2)
2010年9月 (3)
2010年8月 (4)
2010年7月 (2)
文章分類
AJAX(2)
(rss)
Android(2)
(rss)
C#(20)
(rss)
C++(6)
(rss)
ckeditor&ckfinder(1)
(rss)
CSS
(rss)
Delphi(2)
(rss)
Hibernate(39)
(rss)
JAVA(95)
(rss)
jQuery(1)
(rss)
JSP(9)
(rss)
Maven(1)
(rss)
MySQL(4)
(rss)
OOP(1)
(rss)
Python(42)
(rss)
Spring(31)
(rss)
SQL Server(4)
(rss)
Struts2(35)
(rss)
SVN(1)
(rss)
Tomcat(1)
(rss)
Ubuntu(1)
(rss)
軟件加解密技術(shù)
(rss)
雜文(1)
(rss)
文章檔案
2011年8月 (1)
2011年7月 (3)
2011年6月 (19)
2011年5月 (2)
2011年4月 (1)
2011年2月 (1)
2010年12月 (2)
2010年11月 (21)
2010年10月 (67)
2010年9月 (48)
2010年8月 (37)
2010年7月 (4)
新聞檔案
2010年7月 (1)
相冊
CSS
Hibernate
搜索
最新評論
1.?re: Struts2_三種傳參數(shù)方法
方式的發(fā)生
--阿飛史蒂夫
2.?re: 在Win7上搭建JSP開發(fā)環(huán)境
評論內(nèi)容較長,點擊標(biāo)題查看
--鄒
3.?re: ckeditor&ckfinder&s2sh集成
評論內(nèi)容較長,點擊標(biāo)題查看
--庸幾何
4.?re: 在Win7上搭建JSP開發(fā)環(huán)境
下個 myeclipse@lou
--孫毅
5.?re: 在Win7上搭建JSP開發(fā)環(huán)境
@lou
運行 -cmd 找到startup.bat 在java 環(huán)境中運行
--孫毅
閱讀排行榜
1.?開始找Java開發(fā)類工作了(510)
2.?給一家公司的軟件做加密方案(444)
3.?一流、二流、三流(422)
4.?周一到周五都得出差,周末才能回(420)
5.?從WIN32開發(fā)轉(zhuǎn)型到WEB開發(fā)(381)
評論排行榜
1.?周一到周五都得出差,周末才能回(2)
2.?給力2011(2)
3.?最近工作有點忙(0)
4.?生活(0)
5.?在博客園開博了(0)
Powered By:
博客園
模板提供
:
滬江博客
久久e热在这里只有国产中文精品99
|
亚洲嫩草影院久久精品
|
色青青草原桃花久久综合
|
久久久久亚洲AV成人网人人网站
|
国产香蕉久久精品综合网
|
日本强好片久久久久久AAA
|
亚洲狠狠久久综合一区77777
|
久久精品国产WWW456C0M
|
亚洲国产精品无码久久SM
|
久久99精品国产99久久6
|
久久中文字幕人妻熟av女
|
国产成人精品久久一区二区三区
|
久久久久99精品成人片牛牛影视
|
久久久久久亚洲精品成人
|
亚洲精品成人久久久
|
久久精品国产99国产电影网
|
四虎国产精品免费久久5151
|
久久无码国产
|
亚洲欧美精品伊人久久
|
狠狠色丁香久久婷婷综合五月
|
国产精品一久久香蕉国产线看观看
|
94久久国产乱子伦精品免费
|
亚洲国产精品久久久天堂
|
国产精品女同久久久久电影院
|
久久久久亚洲?V成人无码
|
狠狠干狠狠久久
|
99久久无色码中文字幕
|
香蕉久久夜色精品升级完成
|
漂亮人妻被中出中文字幕久久
|
久久人人爽人人爽人人片AV东京热
|
国产精品久久久久久久久免费
|
久久亚洲精品国产精品
|
中文字幕久久精品无码
|
亚洲AV无一区二区三区久久
|
婷婷五月深深久久精品
|
久久精品免费一区二区
|
无遮挡粉嫩小泬久久久久久久
|
97久久国产综合精品女不卡
|
中文字幕乱码久久午夜
|
999久久久免费精品国产
|
高清免费久久午夜精品
|