随笔 - 0  文章 - 0  trackbacks - 0
<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

vooctj@gmail.com

留言簿

文章分类(2)

文章档案(2)

搜索

  •  

最新评论

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]live.cn  
Author:vooctj
From:http://www.blogjava.net/vooctj

posted on 2012-12-15 17:24 vooctj 阅读(71) 评论(0)  编辑  收藏 所属分类: J2EE

只有注册用户登录后才能发表评论。


网站导航: