隨筆: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)林
閱讀(472)
評論(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
<
2011年7月
>
日
一
二
三
四
五
六
26
27
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
常用鏈接
我的隨筆
我的評論
我參與的隨筆
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
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
運(yùn)行 -cmd 找到startup.bat 在java 環(huán)境中運(yùn)行
--孫毅
閱讀排行榜
1.?開始找Java開發(fā)類工作了(514)
2.?給一家公司的軟件做加密方案(446)
3.?一流、二流、三流(424)
4.?周一到周五都得出差,周末才能回(422)
5.?從WIN32開發(fā)轉(zhuǎn)型到WEB開發(fā)(384)
評論排行榜
1.?周一到周五都得出差,周末才能回(2)
2.?給力2011(2)
3.?最近工作有點忙(0)
4.?生活(0)
5.?在博客園開博了(0)
Powered By:
博客園
模板提供
:
滬江博客
99久久国产综合精品网成人影院
|
少妇熟女久久综合网色欲
|
久久九九青青国产精品
|
久久无码国产
|
久久久中文字幕
|
少妇人妻综合久久中文字幕
|
国产精品毛片久久久久久久
|
久久这里有精品视频
|
久久精品国产99国产电影网
|
日本欧美久久久久免费播放网
|
久久AV高清无码
|
亚洲伊人久久综合影院
|
亚洲国产精品久久
|
国产精品久久99
|
日韩精品久久久久久免费
|
久久av高潮av无码av喷吹
|
久久er热视频在这里精品
|
久久人人爽人人爽人人av东京热
|
九九久久精品无码专区
|
精品综合久久久久久97超人
|
亚洲AV伊人久久青青草原
|
99久久夜色精品国产网站
|
久久国产精品77777
|
亚洲AV无码久久
|
国产精品久久久久久久人人看
|
久久91这里精品国产2020
|
2020最新久久久视精品爱
|
99精品久久精品一区二区
|
精品久久久久久无码专区不卡
|
亚洲中文久久精品无码ww16
|
国产激情久久久久久熟女老人
|
久久久久亚洲AV成人网人人网站
|
欧美精品福利视频一区二区三区久久久精品
|
日韩电影久久久被窝网
|
久久精品三级视频
|
成人a毛片久久免费播放
|
久久精品国产精品亚洲
|
久久精品国产72国产精福利
|
久久99精品久久久久久齐齐
|
久久无码国产
|
一本久久a久久精品vr综合
|