|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +
|
| 4 | + Copyright 2010-2023 the original author or authors. |
| 5 | +
|
| 6 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + you may not use this file except in compliance with the License. |
| 8 | + You may obtain a copy of the License at |
| 9 | +
|
| 10 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +
|
| 18 | +--> |
| 19 | +<!-- |
| 20 | + <mybatis:scan> with new property exclude-filter |
| 21 | +--> |
| 22 | +<beans xmlns="http://www.springframework.org/schema/beans" |
| 23 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 24 | + xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:mybatis="http://mybatis.org/schema/mybatis-spring" |
| 25 | + xmlns:context="http://www.springframework.org/schema/context" |
| 26 | + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
| 27 | + http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> |
| 28 | + |
| 29 | + <!-- in-memory database and a datasource --> |
| 30 | + <jdbc:embedded-database id="dataSource"> |
| 31 | + <jdbc:script location="classpath:org/mybatis/spring/batch/db/database-schema.sql"/> |
| 32 | + <jdbc:script location="classpath:org/mybatis/spring/batch/db/database-test-data.sql"/> |
| 33 | + </jdbc:embedded-database> |
| 34 | + |
| 35 | + |
| 36 | + <!-- simplest possible SqlSessionFactory configuration --> |
| 37 | + <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> |
| 38 | + <property name="dataSource" ref="dataSource"/> |
| 39 | + </bean> |
| 40 | + |
| 41 | + |
| 42 | + <mybatis:scan base-package="org.mybatis.spring.filter.datasource"> |
| 43 | + <mybatis:exclude-filter type="annotation" |
| 44 | + expression="${annoFilter}"/> |
| 45 | + </mybatis:scan> |
| 46 | + |
| 47 | +</beans> |
0 commit comments