spring+hibernate配置文件
来源:互联网 发布:java多线程题目 编辑:程序博客网 时间:2024/06/04 19:59
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://localhost:1433;databaseName=mydb">
</property>
<property name="username" value="sa"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/t3/entity/Dept.hbm.xml</value>
<value>com/t3/entity/Emp.hbm.xml</value>
</list>
</property>
</bean>
<bean id="DeptDAOImpl" class="com.t3.dao.impl.DeptDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="EmpDAOImpl" class="com.t3.dao.impl.EmpDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- 代理注入 -->
<bean id="deptService" class="com.t3.biz.impl.DeptServiceImpl">
<property name="deptDAO">
<ref bean="DeptDAOImpl"/>
</property>
</bean>
<bean id="empService" class="com.t3.biz.impl.EmpServiceImpl">
<property name="empDAO">
<ref bean="EmpDAOImpl"/>
</property>
</bean>
<!-- 事务管理器 -->
<bean id="transManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 事务拦截器 -->
<bean id="trInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transManager"></property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<!-- 自动代理 -->
<bean id="autoProxy" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*DAOImpl</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>trInterceptor</value>
</list>
</property>
</bean>
</beans>
- hibernate+spring配置文件
- spring+struts+hibernate配置文件
- spring+hibernate事务管理配置文件
- spring+hibernate配置文件
- struts2+hibernate+spring配置文件
- Hibernate+struts+spring配置文件
- Spring结合hibernate配置文件
- Spring结合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- xfire+spring+hibernate 配置文件
- Spring整合hibernate配置文件
- spring hibernate 配置文件模板
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- Java编程那些事儿110——网络编程小结
- spring+ibatis配置文件
- MYSQL Replication优化总结
- JSP页面跳转的方法总结
- 检讨
- spring+hibernate配置文件
- LINUX删除文章的前几行
- 杰诺在线(垂直搜索引擎研发)
- vc++中_RecordsetPtr使用
- UpdatePanel的使用
- VC++下使用md5函数
- 认识OCP认证
- 在猪市行情低迷时,养猪场容易出现哪些错误
- libjpeg 6b 图像库 Windows 下可编译的VC6.0工程源代码