File tree Expand file tree Collapse file tree 5 files changed +92
-1
lines changed
java/tk/mybatis/springboot/druid Expand file tree Collapse file tree 5 files changed +92
-1
lines changed Original file line number Diff line number Diff line change 79
79
<dependency >
80
80
<groupId >tk.mybatis</groupId >
81
81
<artifactId >mapper-spring-boot-starter</artifactId >
82
- <version >1.0 .0</version >
82
+ <version >1.1 .0</version >
83
83
</dependency >
84
84
<!-- pagehelper-->
85
85
<dependency >
108
108
</dependency >
109
109
</dependencies >
110
110
</plugin >
111
+ <plugin >
112
+ <groupId >org.mybatis.generator</groupId >
113
+ <artifactId >mybatis-generator-maven-plugin</artifactId >
114
+ <version >1.3.2</version >
115
+ <configuration >
116
+ <configurationFile >${basedir} /src/main/resources/generator/generatorConfig.xml</configurationFile >
117
+ <overwrite >true</overwrite >
118
+ <verbose >true</verbose >
119
+ </configuration >
120
+ <dependencies >
121
+ <dependency >
122
+ <groupId >mysql</groupId >
123
+ <artifactId >mysql-connector-java</artifactId >
124
+ <version >${mysql.version} </version >
125
+ </dependency >
126
+ <dependency >
127
+ <groupId >tk.mybatis</groupId >
128
+ <artifactId >mapper</artifactId >
129
+ <version >3.4.0</version >
130
+ </dependency >
131
+ </dependencies >
132
+ </plugin >
111
133
</plugins >
112
134
</build >
113
135
</project >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public class DruidProperties {
13
13
private String url ;
14
14
private String username ;
15
15
private String password ;
16
+ private String driverClass ;
16
17
17
18
private int maxActive ;
18
19
private int minIdle ;
@@ -43,6 +44,14 @@ public void setPassword(String password) {
43
44
this .password = password ;
44
45
}
45
46
47
+ public String getDriverClass () {
48
+ return driverClass ;
49
+ }
50
+
51
+ public void setDriverClass (String driverClass ) {
52
+ this .driverClass = driverClass ;
53
+ }
54
+
46
55
public int getMaxActive () {
47
56
return maxActive ;
48
57
}
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ server.port =9090
2
+ logging.level.tk.mybatis =TRACE
3
+ druid.url =jdbc:mysql://192.168.16.137:3306/test
4
+ druid.driver-class =com.mysql.jdbc.Driver
5
+ druid.username =root
6
+ druid.password:
7
+ druid.initial-size =1
8
+ druid.min-idle =1
9
+ druid.max-active =20
10
+ druid.test-on-borrow =true
11
+ spring.mvc.view.prefix =/templates/
12
+ spring.mvc.view.suffix =.ftl
13
+ spring.freemarker.cache =false
14
+ spring.freemarker.request-context-attribute =request
15
+ mybatis.type-aliases-package =tk.mybatis.springboot.model
16
+ mybatis.mapper-locations =classpath:mapper/*.xml
17
+ mapper.mappers =tk.mybatis.springboot.util.MyMapper
18
+ mapper.not-empty =false
19
+ mapper.identity =MYSQL
20
+ pagehelper.helperDialect =mysql
21
+ pagehelper.reasonable =true
22
+ pagehelper.supportMethodsArguments =true
23
+ pagehelper.params =count =countSql
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE generatorConfiguration
3
+ PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
4
+ "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5
+
6
+ <generatorConfiguration >
7
+ <properties resource =" application.properties" />
8
+
9
+ <context id =" Mysql" targetRuntime =" MyBatis3Simple" defaultModelType =" flat" >
10
+ <property name =" beginningDelimiter" value =" `" />
11
+ <property name =" endingDelimiter" value =" `" />
12
+
13
+ <plugin type =" tk.mybatis.mapper.generator.MapperPlugin" >
14
+ <property name =" mappers" value =" tk.mybatis.springboot.util.MyMapper" />
15
+ </plugin >
16
+
17
+ <jdbcConnection driverClass =" ${druid.driver-class}"
18
+ connectionURL =" ${druid.url}"
19
+ userId =" ${druid.username}"
20
+ password =" ${druid.password}" >
21
+ </jdbcConnection >
22
+
23
+ <javaModelGenerator targetPackage =" tk.mybatis.springboot.model" targetProject =" src/main/java" />
24
+
25
+ <sqlMapGenerator targetPackage =" mapper" targetProject =" src/main/resources" />
26
+
27
+ <javaClientGenerator targetPackage =" tk.mybatis.springboot.mapper" targetProject =" src/main/java"
28
+ type =" XMLMAPPER" />
29
+
30
+ <table tableName =" %" >
31
+ <!-- mysql 配置-->
32
+ <generatedKey column =" id" sqlStatement =" Mysql" identity =" true" />
33
+ <!-- oracle 配置-->
34
+ <!-- <generatedKey column="id" sqlStatement="select SEQ_{1}.nextval from dual" identity="false" type="pre"/>-->
35
+ </table >
36
+ </context >
37
+ </generatorConfiguration >
You can’t perform that action at this time.
0 commit comments