隨筆:15 文章:206 評論:35 引用:0
fenglin
創新、創意、挑戰
C++博客
首頁
發新隨筆
發新文章
聯系
聚合
管理
Spring3_Hibernate&Spring聲明式事務的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
>
<!--
聲明式事務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
>
發表于 2010-10-20 14:23
風林
閱讀(470)
評論(0)
編輯
收藏
引用
所屬分類:
JAVA
、
Hibernate
、
Spring
只有注冊用戶
登錄
后才能發表評論。
【推薦】100%開源!大型工業跨平臺軟件C++源碼提供,建模,組態!
相關文章:
[轉]java編程中'為了性能'一些盡量做到的地方
JAVAC命令行錯誤
Java基礎_Collection接口下的子類存儲特性
Android_常用控件使用
Android_Activity&Intent&Layout
Integer自動裝箱、拆箱問題
自定義比較器、排序
JDBC操作實例
常用數據庫的JDBC連接代碼
[轉]J2SE_內部類
網站導航:
博客園
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)
軟件加解密技術
(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_三種傳參數方法
方式的發生
--阿飛史蒂夫
2.?re: 在Win7上搭建JSP開發環境
評論內容較長,點擊標題查看
--鄒
3.?re: ckeditor&ckfinder&s2sh集成
評論內容較長,點擊標題查看
--庸幾何
4.?re: 在Win7上搭建JSP開發環境
下個 myeclipse@lou
--孫毅
5.?re: 在Win7上搭建JSP開發環境
@lou
運行 -cmd 找到startup.bat 在java 環境中運行
--孫毅
閱讀排行榜
1.?開始找Java開發類工作了(510)
2.?給一家公司的軟件做加密方案(443)
3.?一流、二流、三流(421)
4.?周一到周五都得出差,周末才能回(420)
5.?從WIN32開發轉型到WEB開發(381)
評論排行榜
1.?周一到周五都得出差,周末才能回(2)
2.?給力2011(2)
3.?最近工作有點忙(0)
4.?生活(0)
5.?在博客園開博了(0)
Powered By:
博客園
模板提供
:
滬江博客
久久国产精品国语对白
|
久久99精品久久久久久水蜜桃
|
免费精品99久久国产综合精品
|
久久精品亚洲一区二区三区浴池
|
99久久无色码中文字幕人妻
|
国产精品久久久久国产A级
|
国产午夜精品理论片久久
|
久久伊人五月丁香狠狠色
|
久久婷婷国产综合精品
|
久久久99精品成人片中文字幕
|
国产精品99久久久久久宅男小说
|
精品国产乱码久久久久久1区2区
|
亚洲精品无码久久久
|
久久久久久九九99精品
|
久久午夜综合久久
|
99国产精品久久
|
99蜜桃臀久久久欧美精品网站
|
久久久久久极精品久久久
|
性色欲网站人妻丰满中文久久不卡
|
久久精品视频91
|
久久精品九九亚洲精品天堂
|
亚洲欧洲日产国码无码久久99
|
国产精品热久久无码av
|
久久精品国产影库免费看
|
99久久精品国产高清一区二区
|
一本色道久久88精品综合
|
四虎国产精品免费久久
|
精品久久久久久无码免费
|
久久久久久a亚洲欧洲aⅴ
|
狼狼综合久久久久综合网
|
一本久久知道综合久久
|
久久香综合精品久久伊人
|
亚洲精品成人久久久
|
午夜精品久久久久久久无码
|
韩国无遮挡三级久久
|
久久九九亚洲精品
|
国产精品福利一区二区久久
|
久久精品中文字幕久久
|
久久综合狠狠综合久久激情
|
无码任你躁久久久久久老妇
|
国产精品美女久久久免费
|