Vooctj
首页
新随笔
联系
聚合
管理
随笔 - 0 文章 - 0 trackbacks - 0
<
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
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.blogjava.net/vooctj
posted on 2012-12-15 17:24
vooctj
阅读(71)
评论(0)
编辑
收藏
所属分类:
J2EE
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
Chat2DB
C++博客
博问
管理