123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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"
- 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/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <property name="dataSource" ref="poolDataSource" />
- <property name="packagesToScan">
- <list>
-
- <value>classpath*:com.rtrh.common.modules.*.po</value>
-
- <value>classpath*:com.rtrh.core.plugins.*.po</value>
- <value>classpath*:com.rtrh.projects.modules.*.po</value>
- </list>
- </property>
- <property name="hibernateProperties">
- <value>
-
- hibernate.dialect=org.hibernate.dialect.MySQLDialect
-
- hibernate.hbm2ddl.auto=update
-
- hibernate.show_sql=true
-
- hibernate.format_sql=true
-
- hibernate.cache.use_second_level_cache=true
-
- hibernate.cache.use_query_cache=false
-
- hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
-
- hibernate.jdbc.fetch_size=50
-
- hibernate.jdbc.batch_size=50
-
- hibernate.connection.autocommit=false
-
- hibernate.connection.release_mode=auto
-
- hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringSessionContext
-
- javax.persistence.validation.mode=none
- </value>
- </property>
- <property name="entityInterceptor">
- <ref bean="entityInterceptor" />
- </property>
- <property name="mappingLocations">
- <list>
-
- <value>classpath*:/com/rtrh/common/modules/*/po/*.hbm.xml</value>
-
- <value>classpath*:/com/rtrh/core/plugins/*/po/*.hbm.xml</value>
- <value>classpath*:/com/rtrh/projects/modules/*/po/*.hbm.xml</value>
- </list>
- </property>
- </bean>
- <bean id="eventListener" class="com.rtrh.core.repository.hibernate.EventListener" />
- <bean id="entityInterceptor" class="com.rtrh.core.repository.hibernate.EntityInterceptor" />
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate4.HibernateTransactionManager">
- <property name="sessionFactory" ref="sessionFactory" />
- </bean>
- <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
- <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" />
- <aop:aspectj-autoproxy/>
- <tx:advice id="txAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <tx:method name="*" rollback-for="java.lang.Exception" />
- <tx:method name="*" rollback-for="java.lang.RuntimeException" />
- <tx:method name="create*" propagation="REQUIRED" />
- <tx:method name="save*" propagation="REQUIRED" />
- <tx:method name="add*" propagation="REQUIRED" />
- <tx:method name="update*" propagation="REQUIRED" />
- <tx:method name="remove*" propagation="REQUIRED" />
- <tx:method name="del*" propagation="REQUIRED" />
- <tx:method name="import*" propagation="REQUIRED" />
- </tx:attributes>
- </tx:advice>
- <aop:config proxy-target-class="true">
-
- <aop:pointcut id="corePluginServiceMethods" expression="execution(* com.rtrh.core.plugins..*.*(..))" />
-
- <aop:pointcut id="commModulesServiceMethods" expression="execution(* com.rtrh.common.modules..*.*(..))" />
-
- <aop:pointcut id="extModulesServiceMethods" expression="execution(* com.rtrh.ext.modules..*.*(..))" />
- <aop:pointcut id="projectsModulesServiceMethods" expression="execution(* com.rtrh.projects.modules..*.*(..))" />
- <aop:advisor advice-ref="txAdvice" pointcut-ref="corePluginServiceMethods" />
- <aop:advisor advice-ref="txAdvice" pointcut-ref="commModulesServiceMethods" />
- <aop:advisor advice-ref="txAdvice" pointcut-ref="extModulesServiceMethods" />
- <aop:advisor advice-ref="txAdvice" pointcut-ref="projectsModulesServiceMethods" />
- </aop:config>
-
-
- <bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor"/>
- <bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
- <property name="patterns">
- <list>
- <value>com.rtrh.projects.*</value>
- </list>
- </property>
- </bean>
- <aop:config proxy-target-class="true">
- <aop:advisor advice-ref="druid-stat-interceptor" pointcut-ref="druid-stat-pointcut"/>
- </aop:config>
- </beans>
|