forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplicationContext-dao-config.xml
78 lines (64 loc) · 3.62 KB
/
applicationContext-dao-config.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?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.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:component-scan base-package="com.navercorp.pinpoint.web.dao.mysql" />
<!-- Transaction manager for a single JDBC DataSource -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="select*" read-only="true" />
<tx:method name="read*" read-only="true" />
<tx:method name="get*" read-only="true" />
<tx:method name="view*"/>
<tx:method name="list*"/>
<tx:method name="add*"/>
<tx:method name="create*"/>
<tx:method name="delete*"/>
<tx:method name="update*"/>
</tx:attributes>
</tx:advice>
<!-- SqlsessionFactory setup for MyBatis Database Layer -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- mybatis basic config -->
<property name="configLocation" value="classpath:/mybatis-config.xml"/>
<!-- typeAliases -->
<property name="typeAliasesPackage" value="com.navercorp.pinpoint.web.vo,com.navercorp.pinpoint.web.alarm.vo" />
<!-- setting the location of mapper -->
<property name="mapperLocations" value="classpath*:mapper/*Mapper.xml"/>
<!-- set "true" in order to catch the errors of declaration of statement more quickly -->
<property name="failFast" value="true"/>
<property name="plugins">
<list>
<!-- use the patch version because of mybatis 3.2's incompatibility-->
<bean class="com.navercorp.pinpoint.web.dao.ibatis.BindingLogPlugin32"/>
</list>
</property>
</bean>
<!-- in case of using interface mapper
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.navercorp.pinpoint.web.mapper.mysql" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
-->
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory"></constructor-arg>
</bean>
<!-- setting of executorType for batch -->
<bean id="batchSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory"/>
<constructor-arg index="1" value="BATCH"/>
</bean>
<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="transactionManager"/>
</bean>
</beans>