Vooctj
首頁
新隨筆
聯系
聚合
管理
隨筆 - 0 文章 - 0 trackbacks - 0
<
2025年6月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
31
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
1
2
3
4
5
vooctj
@
gmail.com
留言簿
給我留言
查看公開留言
查看私人留言
文章分類
(2)
Android(1)
Html5
J2EE(1)
Javascript
Linux
Mysql
oracle
數據結構
文章檔案
(2)
2012年12月 (1)
2012年1月 (1)
搜索
最新評論
spring 和hibernate 常規配置
applicationContext.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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- transactionManager -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- advice -->
<tx:advice id="tx" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" isolation="DEFAULT" propagation="REQUIRED" read-only="false"/>
</tx:attributes>
</tx:advice>
<!-- sessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate/hibernate.cfg.xml">
</property>
</bean>
<!-- aop -->
<aop:config>
<aop:pointcut expression="execution(* com.vooctj.service.impl.*.*(..))" id="perfom"/>
<aop:advisor advice-ref="tx" pointcut-ref="perfom"/>
</aop:config>
<!-- entity studentDAO -->
<bean id="studentDAO" class="com.vooctj.dao.impl.StudentDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- entity studentService-->
<bean id="studentService" class="com.vooctj.service.impl.StudentServiceImpl">
<property name="studentDAO">
<ref bean="studentDAO"/>
</property>
</bean>
</beans>
Mail:
vooctj
[at]
gmail.com
Msn:
voox
[at]
l
ive.cn
Author:
vooctj
From:
http://www.aygfsteel.com/vooctj
posted on 2012-12-15 17:24
vooctj
閱讀(70)
評論(0)
編輯
收藏
所屬分類:
J2EE
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Copyright ©2025 vooctj Powered by:
博客園
模板提供:
滬江博客
主站蜘蛛池模板:
疏附县
|
民和
|
万州区
|
甘肃省
|
台山市
|
大城县
|
岑溪市
|
龙游县
|
年辖:市辖区
|
全椒县
|
安塞县
|
吴旗县
|
旬邑县
|
绵竹市
|
綦江县
|
凤庆县
|
揭阳市
|
长沙县
|
汤阴县
|
肥西县
|
中宁县
|
上栗县
|
肃宁县
|
永靖县
|
南丹县
|
辽宁省
|
祥云县
|
都昌县
|
曲周县
|
甘孜
|
祁门县
|
富顺县
|
收藏
|
偃师市
|
开远市
|
宁蒗
|
固原市
|
宽甸
|
固安县
|
安新县
|
玉屏
|