| 1946 |
chandransh |
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 |
<!--
|
|
|
3 |
Copyright 2010 The myBatis Team
|
|
|
4 |
|
|
|
5 |
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
6 |
you may not use this file except in compliance with the License.
|
|
|
7 |
You may obtain a copy of the License at
|
|
|
8 |
|
|
|
9 |
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
10 |
|
|
|
11 |
Unless required by applicable law or agreed to in writing, software
|
|
|
12 |
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
13 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
14 |
See the License for the specific language governing permissions and
|
|
|
15 |
limitations under the License.
|
|
|
16 |
-->
|
|
|
17 |
|
|
|
18 |
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
19 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
20 |
xmlns:aop="http://www.springframework.org/schema/aop"
|
|
|
21 |
xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
22 |
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
|
|
23 |
xmlns:context="http://www.springframework.org/schema/context"
|
|
|
24 |
xsi:schemaLocation="
|
|
|
25 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
|
|
26 |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
|
|
27 |
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
|
|
|
28 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
|
|
29 |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
|
|
|
30 |
|
|
|
31 |
<bean id="dataSource"
|
|
|
32 |
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
|
|
33 |
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
|
|
34 |
<property name="url" value="${jdbc.url}"/>
|
|
|
35 |
<property name="username" value="${jdbc.username}"/>
|
|
|
36 |
<property name="password" value="${jdbc.password}"/>
|
|
|
37 |
</bean>
|
|
|
38 |
|
|
|
39 |
<context:property-placeholder location="classpath:jdbc.properties"/>
|
|
|
40 |
|
|
|
41 |
<!-- in-memory database and a datasource -->
|
|
|
42 |
<!-- <jdbc:embedded-database id="dataSource"> -->
|
|
|
43 |
<!-- <jdbc:script location="classpath:database/jpetstore-hsqldb-schema.sql"/> -->
|
|
|
44 |
<!-- <jdbc:script location="classpath:database/jpetstore-hsqldb-dataload.sql"/> -->
|
|
|
45 |
<!-- </jdbc:embedded-database> -->
|
|
|
46 |
|
|
|
47 |
<!-- transaction manager, use JtaTransactionManager for global tx -->
|
|
|
48 |
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
|
|
49 |
<property name="dataSource" ref="dataSource" />
|
|
|
50 |
</bean>
|
|
|
51 |
|
|
|
52 |
<!-- enable component scanning (beware that this does not enable mapper scanning!) -->
|
|
|
53 |
<context:component-scan base-package="in.shop2020.payment.handler" />
|
|
|
54 |
|
|
|
55 |
<!-- enable autowire -->
|
|
|
56 |
<context:annotation-config />
|
|
|
57 |
|
|
|
58 |
<!-- enable transaction demarcation with annotations -->
|
|
|
59 |
<tx:annotation-driven />
|
|
|
60 |
|
|
|
61 |
<!-- define the SqlSessionFactory, notice that configLocation is not needed when you use MapperFactoryBean -->
|
|
|
62 |
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
|
63 |
<property name="dataSource" ref="dataSource" />
|
|
|
64 |
<property name="configLocation" value="classpath:mybatis-config.xml" />
|
|
|
65 |
</bean>
|
|
|
66 |
|
|
|
67 |
<!-- scan for mappers and let them be autowired -->
|
|
|
68 |
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
|
|
69 |
<property name="basePackage" value="in.shop2020.payment.persistence" />
|
|
|
70 |
</bean>
|
|
|
71 |
</beans>
|