<?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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-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/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl"
value="jdbc:mysql://192.168.1.231:3306/test?useunicode=true;characterEncoding=utf-8;" />
<property name="user" value="root" />
<property name="password" value="123" />
<property name="maxPoolSize">
<value>5</value>
</property>
<property name="minPoolSize">
<value>5</value>
</property>
<property name="initialPoolSize">
<value>5</value>
</property>
<property name="maxIdleTime">
<value>20</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/uniwin/framework/model/Userdetail.hbm.xml
</value>
<value>com/uniwin/framework/model/Users.hbm.xml
</value>
<value>com/uniwin/framework/model/Resource.hbm.xml
</value>
<value>com/uniwin/framework/model/Permission.hbm.xml </value>
<value>com/uniwin/framework/model/Permissionresource.hbm.xml </value>
<value>com/uniwin/framework/model/Role.hbm.xml </value>
<value>com/uniwin/framework/model/Permissionrole.hbm.xml </value>
<value>com/uniwin/framework/model/Organization.hbm.xml </value>
<value>com/uniwin/framework/model/Userrole.hbm.xml </value>
<value>com/uniwin/framework/model/Usersfavorate.hbm.xml </value>
<value>com/uniwin/framework/model/Operation.hbm.xml </value>
<value>com/uniwin/framework/model/Welcome.hbm.xml </value>
<value>com/uniwin/framework/model/Alarmclock.hbm.xml </value>
<value>com/uniwin/framework/model/Userwelcome.hbm.xml </value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop key="hibernate.show_sql">false</prop>
<!--
<prop key="hibernate.query.substitutions"> true 'Y', false 'N'
</prop> Create/update the database tables automatically when the
JVM starts up <prop key="hibernate.hbm2ddl.auto">update</prop>
-->
<!--
Turn batching off for better error messages under PostgreSQL <prop
key="hibernate.jdbc.batch_size">0</prop>
-->
</props>
</property>
</bean>
<!-- 建立事务管理器 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<!-- 定义事务通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 对查找方法进行只读事务通知要求查找方法以find开头可按需要修改 -->
<tx:method name="find*" propagation="SUPPORTS" read-only="true" />
<tx:method name="get" propagation="SUPPORTS" read-only="true" />
<tx:method name="get*" propagation="SUPPORTS" read-only="true" />
<tx:method name="query*" propagation="SUPPORTS" read-only="true" />
<!-- 对其它方法如增 删 改进行事务支持 -->
<tx:method name="add" propagation="REQUIRED" rollback-for="Throwable" />
<tx:method name="add*" propagation="REQUIRED" rollback-for="Throwable" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="remove" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="move*" propagation="REQUIRED" />
<tx:method name="update" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="is*" propagation="REQUIRED" />
<tx:method name="has*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="bizMethods"
expression="execution(* com.uniwin.framework..*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="bizMethods" />
<aop:aspect id="log4j" ref="genericLoggerBean">
<aop:around pointcut-ref="bizMethods" method="invoke" />
</aop:aspect>
</aop:config>
<bean id="genericLoggerBean" class="com.uniwin.framework.logger.GenericLoggerBean" />
<!-- hibernateTemplate配置事务的结束 -->
<!-- jdbcTemplate配置 开始-->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- jdbcTemplate配置 结束-->
<!--用户管理开始-->
<bean id="userdetailDAO" class="com.uniwin.framework.userdetail.dao.UserdetailDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="userdetailManager"
class="com.uniwin.framework.userdetail.service.UserdetailManagerImpl">
<property name="userdetailDAO" ref="userdetailDAO" />
</bean>
<bean id="usersDAO" class="com.uniwin.framework.users.dao.UsersDAOImpl" >
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="usersManager" class="com.uniwin.framework.users.service.UsersManagerImpl">
<!-- <property name="jdbcTemplate" ref="jdbcTemplate" /> -->
<property name="usersDAO" ref="usersDAO" />
<property name="welcomeDao" ref="welcomeDAO"></property>
<property name="roleManager" ref="roleManager" />
<property name="organizationManager" ref="organizationManager" />
</bean>
<bean id="userroleDAO" class="com.uniwin.framework.userrole.dao.UserroleDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="userroleManager"
class="com.uniwin.framework.userrole.service.UserroleManagerImpl">
<property name="userroleDAO" ref="userroleDAO" />
</bean>
<!--用户管理结束-->
<!-- 资源管理开始 -->
<bean id="resourceDAO" class="com.uniwin.framework.resource.dao.ResourceDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
<bean id="resourceManager"
class="com.uniwin.framework.resource.service.ResourceManagerImpl">
<property name="resourceDAO" ref="resourceDAO" />
<property name="permissionroleDAO" ref="permissionroleDAO"></property>
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
<!-- 资源管理结束 -->
<!-- PERMISSION-->
<bean id="permissionDAO" class="com.uniwin.framework.permission.dao.PermissionDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
<bean id="permissionManager"
class="com.uniwin.framework.permission.service.PermissionManagerImpl">
<property name="permissionDAO" ref="permissionDAO" />
<property name="permissionresourceManager" ref="permissionresourceManager" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
<!-- PERMISSIONRESOURCE-->
<bean id="permissionresourceDAO"
class="com.uniwin.framework.permissionresource.dao.PermissionresourceDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="permissionresourceManager"
class="com.uniwin.framework.permissionresource.service.PermissionresourceManagerImpl">
<property name="permissionresourceDAO" ref="permissionresourceDAO" />
<property name="permissionManager" ref="permissionManager" />
</bean>
<!-- PERMISSIONROLE-->
<bean id="permissionroleDAO"
class="com.uniwin.framework.permissionrole.dao.PermissionroleDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="permissionroleManager"
class="com.uniwin.framework.permissionrole.service.PermissionroleManagerImpl">
<property name="permissionroleDAO" ref="permissionroleDAO" />
</bean>
<!-- ROLE-->
<bean id="roleDAO" class="com.uniwin.framework.role.dao.RoleDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="roleManager" class="com.uniwin.framework.role.service.RoleManagerImpl">
<property name="roleDAO" ref="roleDAO" />
<property name="permissionroleManager" ref="permissionroleManager" />
</bean>
<!-- 组织管理开始-->
<bean id="organizationDAO"
class="com.uniwin.framework.organization.dao.OrganizationDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="organizationManager"
class="com.uniwin.framework.organization.service.OrganizationManagerImpl">
<property name="organizationDAO" ref="organizationDAO" />
</bean>
<!-- 组织管理结束-->
<!-- UsersFavorate-->
<bean id="usersfavorateDAO"
class="com.uniwin.framework.usersfavorate.dao.UsersfavorateDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="usersfavorateManager"
class="com.uniwin.framework.usersfavorate.service.UsersfavorateManagerImpl">
<property name="usersfavorateDAO" ref="usersfavorateDAO" />
</bean>
<bean id="frameCommonDate"
class="com.uniwin.framework.data.FrameCommonDate">
<property name="resourceManager" ref="resourceManager" />
</bean>
<!-- OPERATION-->
<bean id="operationDAO" class="com.uniwin.framework.operation.dao.OperationDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="operationManager" class="com.uniwin.framework.operation.service.OperationManagerImpl">
<property name="operationDAO" ref="operationDAO" />
</bean>
<!-- welcome-->
<bean id="welcomeDAO" class="com.uniwin.framework.welcome.dao.WelcomeDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="welcomeManager" class="com.uniwin.framework.welcome.service.WelcomeManagerImpl">
<property name="welcomeDAO" ref="welcomeDAO" />
</bean>
<!-- alarmClock-->
<bean id="alarmclockDAO" class="com.uniwin.framework.alarmclock.dao.AlarmclockDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="alarmclockManager" class="com.uniwin.framework.alarmclock.service.AlarmclockManagerImpl">
<property name="alarmclockDAO" ref="alarmclockDAO" />
</bean>
</beans>
spring配置
最新推荐文章于 2024-04-21 17:10:11 发布