<?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:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
<!-- 配置数据源-->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="username" value="scott"></property>
<property name="password" value="admin" ></property>
<property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:lgf" />
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
</bean>
<!-- 配置hibernate本地会话工厂-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property><property name="mappingLocations" value="classpath:com/code/entity/*.hbm.xml" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
</props>
</property>
</bean>
<!-- 配置hibernate事务管理-->
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 配置事务通知-->
<tx:advice transaction-manager="transactionManager" id="tx_advice">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
<!-- 配置执行的方法表达式,切入点-->
<aop:config>
<aop:pointcut expression="execution(* com.ssh.service.*.*(..))" id="tx_pointcut"/>
<aop:advisor advice-ref="tx_advice" pointcut-ref="tx_pointcut"/>
</aop:config>
</beans>
分享到:
相关推荐
Spring整合Hibernate配置测试示例
spring与hibernate的整合 spring事务的配置
hibernate与spring整合demohibernate与spring整合demo
spring 整合hibernate的事物配置
传播智客,为Spring集成的Hibernate配置二级缓存、cache.xml
a 加入支持:添加 spring核心包、hibernate 3.6 包、 spring整合hibernate包 , 在src下建立applicationContext.xml (先建立src下便于测试hibernate)。 b 编写实体类,加入hibernate注解,编写方法类测试类,在...
spring和hibernate整合的优化配置.txt
12.6.16 编写Spring和Hibernate的配置文件spring-config.xml 12.6.17 编写web.xml 12.6.18 验证示例 12.7 小结 第四篇 J2EE项目案例精选 第十三章 网上调查系统 13.1 系统概述 13.2 需求分析 13.2.1 系统用例图 ...
Spring+Struts+Hibernate比较详细的整合配置方案
Flex+Spring+Hibernate 整合的方式有多种,本文是利用flex builder插件,将flex与javaEE服务器端整合到一个工程里面,以便程序员可以在一个IDE里完成开发。
NULL 博文链接:https://8366.iteye.com/blog/412303
spring整合struts2与hibernate核心配置文件
6.5 Spring整合Hibernate 6.6 Spring提供的DAO支持 6.5.2 管理Hibernate的SessionFactory 6.5.3 使用HibernateTemplate 6.5.4 使用HibernateCallBack 6.5.6 使用IoC容器组装各种组件 6.5.7启动web容器读取xml配置...
Struts+Spring+Hibernate整合注册登录 木子提供下载(包括本word文档和源程序) http://usc.googlecode.com/files/SSH.rar 开发环境: 1. MyEclipse Enterprise Workbench 7.0 Milestone-1(MyEclipse 7.0 M1...
Spring整合Hibernate示例完整代码,里面概括了各种配置的细节。
webwork Spring hibernate整合配置.doc
Struts2 Spring3.0 Hibernate3.3 全注解配置,避免了大量业务类在Spring文件的配置,整合了DWR3.0,displayTag 物理分页技术的实现。树形菜单。 另外数据库,在下一个资源;由于20MB的限制。 有问题的话留言。
struts+spring+hibernate配置笔记
Struts2 Spring Hibernate的配置及登录实例的详细说明(附源码)
Struts2 Spring3 Hibernate3.3框架整合,增删改查,包含有数据库建表语句,包含有JAR包,包含有源代码。包含有事务的配置以及运用。使用的是Oracle的序列来提供的主键自增,建表和建立序列的sql语句,已经放在工程...