-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmybatis-config_xml.template
executable file
·61 lines (56 loc) · 2.32 KB
/
mybatis-config_xml.template
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- @Created with Atom -->
<!-- @author @author@ -->
<!-- @time @now@ -->
<!-- @description -->
<!-- mybatis-config.xml -->
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<properties resource="classpath:properties/jdbc.properties" />
<settings>
<!-- 开启驼峰匹配 -->
<setting name="mapUnderscoreToCamelCase" value="true" />
</settings>
<typeAliases>
<!-- 单个别名定义 -->
<typeAlias alias="xx" type="entity.XX" />
<!-- 批量别名定义,扫描整个包下的类,别名为类名(首字母大小写都可以) -->
<package name="entity" />
<package name="其它包" />
</typeAliases>
<plugins>
<!-- 通用Mapper插件 -->
<plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor">
<!--主键自增回写方法,默认值MYSQL,详细说明请看文档-->
<property name="IDENTITY" value="MYSQL" />
<!--序列的获取规则,使用{num}格式化参数,默认值为{0}.nextval,针对Oracle-->
<!--可选参数一共3个,对应0,1,2,分别为SequenceName,ColumnName,PropertyName-->
<!-- <propertyname="seqFormat" value="{0}.nextval"/> -->
<!--通用Mapper接口,多个通用接口用逗号隔开-->
<property name="mappers" value="Mapper" />
</plugin>
<!-- 分页查询插件 -->
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql" />
<!-- 设置为true时,使用RowBounds分页会进行count查询,查询数据总条数 -->
<property name="rowBoundsWithCount" value="true" />
</plugin>
</plugins>
<!-- 配置数据库连接的环境 -->
<environments default="development">
<environment id="development">
<transactionManager type="JDBC" />
<dataSource type="POOLED">
<property name="driver" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</dataSource>
</environment>
</environments>
<mappers>
<!-- 引入Mapper.xml -->
<mapper resource="resources/mapper/XXMapper.xml" />
<package name="mapper" />
</mappers>
</configuration>