34 lines
1.7 KiB
XML
34 lines
1.7 KiB
XML
<?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:jdbc="http://www.springframework.org/schema/jdbc"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
http://www.springframework.org/schema/context
|
|
http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
|
|
<!-- 自动扫描 -->
|
|
<context:component-scan base-package="com.ai.cloud.skywalking.sample"/>
|
|
|
|
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
<property name="dataSource" ref="dataSource"/>
|
|
<!-- 自动扫描mapping.xml文件 -->
|
|
<property name="mapperLocations" value="classpath:mybatis/*.xml"></property>
|
|
</bean>
|
|
|
|
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
|
<property name="basePackage" value="com.ai.cloud.skywalking.sample.mybatis"/>
|
|
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
|
|
</bean>
|
|
|
|
<bean id="transactionManager"
|
|
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
|
<property name="dataSource" ref="dataSource"/>
|
|
</bean>
|
|
|
|
<jdbc:embedded-database id="dataSource" type="H2">
|
|
<jdbc:script location="classpath:db/sql/create-db.sql" />
|
|
</jdbc:embedded-database>
|
|
|
|
<import resource="classpath*:provider/dubbo-provider.xml"/>
|
|
</beans>
|