隨筆: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:
博客園
模板提供
:
滬江博客
久久免费线看线看
|
国产精品美女久久久久av爽
|
久久九色综合九色99伊人
|
久久久国产99久久国产一
|
好久久免费视频高清
|
中文字幕精品无码久久久久久3D日动漫
|
久久亚洲中文字幕精品有坂深雪
|
99久久精品国产毛片
|
无码人妻久久一区二区三区蜜桃
|
99国内精品久久久久久久
|
99久久精品国产毛片
|
亚洲AV无码久久精品成人
|
思思久久99热只有频精品66
|
无码人妻久久一区二区三区免费丨
|
久久精品国产99国产精偷
|
91麻豆国产精品91久久久
|
一级做a爰片久久毛片16
|
97精品伊人久久久大香线蕉
|
国内精品久久国产
|
国产精品美女久久久久AV福利
|
久久中文骚妇内射
|
国产69精品久久久久APP下载
|
久久久久国产一级毛片高清版
|
久久国产劲爆AV内射—百度
|
一本一道久久a久久精品综合
|
久久99国产精品一区二区
|
久久精品中文无码资源站
|
婷婷久久综合九色综合绿巨人
|
一个色综合久久
|
精品国产综合区久久久久久
|
无遮挡粉嫩小泬久久久久久久
|
久久精品99久久香蕉国产色戒
|
久久精品成人欧美大片
|
久久电影网一区
|
久久99精品久久久久久hb无码
|
一本色道久久综合亚洲精品
|
久久亚洲欧洲国产综合
|
麻豆久久久9性大片
|
欧美精品丝袜久久久中文字幕
|
久久久久综合网久久
|
99久久精品国产毛片
|