隨筆: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
風林
閱讀(466)
評論(0)
編輯
收藏
引用
所屬分類:
JAVA
、
Hibernate
、
Spring
只有注冊用戶
登錄
后才能發表評論。
【推薦】100%開源!大型工業跨平臺軟件C++源碼提供,建模,組態!
相關文章:
[轉]java編程中'為了性能'一些盡量做到的地方
JAVAC命令行錯誤
Java基礎_Collection接口下的子類存儲特性
Android_常用控件使用
Android_Activity&Intent&Layout
Integer自動裝箱、拆箱問題
自定義比較器、排序
JDBC操作實例
常用數據庫的JDBC連接代碼
[轉]J2SE_內部類
網站導航:
博客園
IT新聞
BlogJava
博問
Chat2DB
管理
CALENDER
<
2025年5月
>
日
一
二
三
四
五
六
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
7
常用鏈接
我的隨筆
我的評論
我參與的隨筆
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
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開發類工作了(504)
2.?給一家公司的軟件做加密方案(441)
3.?周一到周五都得出差,周末才能回(415)
4.?一流、二流、三流(408)
5.?最近工作有點忙(377)
評論排行榜
1.?周一到周五都得出差,周末才能回(2)
2.?給力2011(2)
3.?最近工作有點忙(0)
4.?生活(0)
5.?在博客園開博了(0)
Powered By:
博客園
模板提供
:
滬江博客
人妻无码αv中文字幕久久
|
久久精品亚洲福利
|
怡红院日本一道日本久久
|
亚洲精品99久久久久中文字幕
|
无码专区久久综合久中文字幕
|
久久天天躁狠狠躁夜夜av浪潮
|
久久播电影网
|
国产精品内射久久久久欢欢
|
久久香蕉国产线看观看99
|
久久av无码专区亚洲av桃花岛
|
久久久久亚洲av无码专区喷水
|
香蕉久久夜色精品升级完成
|
亚洲中文字幕无码久久精品1
|
亚洲成色www久久网站夜月
|
日韩av无码久久精品免费
|
国产麻豆精品久久一二三
|
91久久九九无码成人网站
|
18岁日韩内射颜射午夜久久成人
|
亚洲精品乱码久久久久久
|
亚洲色大成网站WWW久久九九
|
性高湖久久久久久久久
|
九九99精品久久久久久
|
国内精品免费久久影院
|
久久午夜夜伦鲁鲁片免费无码影视
|
久久久久免费精品国产
|
国产精品久久久久久久久免费
|
91精品国产91久久久久久蜜臀
|
草草久久久无码国产专区
|
亚洲国产成人久久综合碰
|
亚洲精品国精品久久99热一
|
色成年激情久久综合
|
人妻少妇精品久久
|
久久精品天天中文字幕人妻
|
国产精品一区二区久久不卡
|
国产精品久久久久一区二区三区
|
精品国产乱码久久久久软件
|
.精品久久久麻豆国产精品
|
亚洲精品综合久久
|
91精品无码久久久久久五月天
|
九九精品99久久久香蕉
|
色婷婷狠狠久久综合五月
|