Skip to content

Commit 59c61ec

Browse files
authored
Merge pull request #1 from mybatis/master
feat: pull update
2 parents 4b91bc7 + 002a525 commit 59c61ec

File tree

85 files changed

+2149
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2149
-568
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*.{java, xml, sql}]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
language: java
22

33
jdk:
4+
- openjdk12
45
- oraclejdk11
56
- oraclejdk8
67

8+
services:
9+
- docker
10+
11+
cache:
12+
directories:
13+
- $HOME/.m2
14+
715
before_install:
816
- echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc
917

ISSUE_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
⭕️ 请将您的问题发送到邮件列表
44
請用英文寫
55
https://groups.google.com/group/mybatis-user
6+
7+
https://stackoverflow.com/questions/ask?tags=mybatis
68
79
Question?
810
======================
911
Please use the mailing list. http://groups.google.com/group/mybatis-user
12+
Or Stack Overflow with 'mybatis' tag. https://stackoverflow.com/questions/ask?tags=mybatis
1013
Questions on this tracker will be closed without comment.
1114
1215
Bug report?

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MyBatis SQL Mapper Framework for Java
44
[![Build Status](https://travis-ci.org/mybatis/mybatis-3.svg?branch=master)](https://travis-ci.org/mybatis/mybatis-3)
55
[![Coverage Status](https://coveralls.io/repos/mybatis/mybatis-3/badge.svg?branch=master&service=github)](https://coveralls.io/github/mybatis/mybatis-3?branch=master)
66
[![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
7+
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.mybatis/mybatis.svg)](https://oss.sonatype.org/content/repositories/snapshots/org/mybatis/mybatis)
78
[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
89
[![Stack Overflow](http://img.shields.io/:stack%20overflow-mybatis-brightgreen.svg)](http://stackoverflow.com/questions/tagged/mybatis)
910
[![Project Stats](https://www.openhub.net/p/mybatis/widgets/project_thin_badge.gif)](https://www.openhub.net/p/mybatis)

pom.xml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</parent>
2828

2929
<artifactId>mybatis</artifactId>
30-
<version>3.5.1-SNAPSHOT</version>
30+
<version>3.5.2-SNAPSHOT</version>
3131
<packaging>jar</packaging>
3232

3333
<name>mybatis</name>
@@ -132,7 +132,7 @@
132132

133133
<properties>
134134
<clirr.comparisonVersion>3.4.6</clirr.comparisonVersion>
135-
<excludedGroups>EmbeddedPostgresqlTests</excludedGroups>
135+
<excludedGroups>TestcontainersTests</excludedGroups>
136136
<maven.compiler.testCompilerArgument>-parameters</maven.compiler.testCompilerArgument>
137137
<module.name>org.mybatis</module.name>
138138
<osgi.export>org.apache.ibatis.*;version=${project.version};-noimport:=true</osgi.export>
@@ -159,13 +159,13 @@
159159
<dependency>
160160
<groupId>org.slf4j</groupId>
161161
<artifactId>slf4j-api</artifactId>
162-
<version>1.7.25</version>
162+
<version>1.7.26</version>
163163
<optional>true</optional>
164164
</dependency>
165165
<dependency>
166166
<groupId>org.slf4j</groupId>
167167
<artifactId>slf4j-log4j12</artifactId>
168-
<version>1.7.25</version>
168+
<version>1.7.26</version>
169169
<optional>true</optional>
170170
</dependency>
171171
<dependency>
@@ -177,7 +177,7 @@
177177
<dependency>
178178
<groupId>org.apache.logging.log4j</groupId>
179179
<artifactId>log4j-core</artifactId>
180-
<version>2.11.1</version>
180+
<version>2.11.2</version>
181181
<optional>true</optional>
182182
</dependency>
183183
<dependency>
@@ -197,7 +197,7 @@
197197
<dependency>
198198
<groupId>org.junit.jupiter</groupId>
199199
<artifactId>junit-jupiter-engine</artifactId>
200-
<version>5.3.2</version>
200+
<version>5.4.1</version>
201201
<scope>test</scope>
202202
</dependency>
203203
<dependency>
@@ -206,7 +206,7 @@
206206
<version>2.4.1</version>
207207
<scope>test</scope>
208208
</dependency>
209-
<dependency>
209+
<dependency> <!-- 10.15+ need Java 9+ -->
210210
<groupId>org.apache.derby</groupId>
211211
<artifactId>derby</artifactId>
212212
<version>10.14.2.0</version>
@@ -215,19 +215,19 @@
215215
<dependency>
216216
<groupId>org.mockito</groupId>
217217
<artifactId>mockito-core</artifactId>
218-
<version>2.23.4</version>
218+
<version>2.25.1</version>
219219
<scope>test</scope>
220220
</dependency>
221221
<dependency>
222222
<groupId>org.mockito</groupId>
223223
<artifactId>mockito-junit-jupiter</artifactId>
224-
<version>2.23.4</version>
224+
<version>2.25.1</version>
225225
<scope>test</scope>
226226
</dependency>
227227
<dependency>
228228
<groupId>org.apache.commons</groupId>
229229
<artifactId>commons-dbcp2</artifactId>
230-
<version>2.5.0</version>
230+
<version>2.6.0</version>
231231
<scope>test</scope>
232232
</dependency>
233233
<dependency>
@@ -252,7 +252,7 @@
252252
<dependency>
253253
<groupId>org.assertj</groupId>
254254
<artifactId>assertj-core</artifactId>
255-
<version>3.11.1</version>
255+
<version>3.12.2</version>
256256
<scope>test</scope>
257257
</dependency>
258258
<dependency>
@@ -262,9 +262,15 @@
262262
<scope>test</scope>
263263
</dependency>
264264
<dependency>
265-
<groupId>ru.yandex.qatools.embed</groupId>
266-
<artifactId>postgresql-embedded</artifactId>
267-
<version>2.10</version>
265+
<groupId>org.testcontainers</groupId>
266+
<artifactId>junit-jupiter</artifactId>
267+
<version>1.11.2</version>
268+
<scope>test</scope>
269+
</dependency>
270+
<dependency>
271+
<groupId>org.testcontainers</groupId>
272+
<artifactId>postgresql</artifactId>
273+
<version>1.11.2</version>
268274
<scope>test</scope>
269275
</dependency>
270276
</dependencies>

src/main/java/org/apache/ibatis/annotations/DeleteProvider.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,33 @@
2828
@Retention(RetentionPolicy.RUNTIME)
2929
@Target(ElementType.METHOD)
3030
public @interface DeleteProvider {
31+
32+
/**
33+
* Specify a type that implements an SQL provider method.
34+
*
35+
* @return a type that implements an SQL provider method
36+
*/
3137
Class<?> type();
3238

33-
String method();
39+
/**
40+
* Specify a method for providing an SQL.
41+
*
42+
* <p>
43+
* Since 3.5.1, this attribute can omit.
44+
* If this attribute omit, the MyBatis will call a method that decide by following rules.
45+
* <ul>
46+
* <li>
47+
* If class that specified the {@link #type()} attribute implements the {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver},
48+
* the MyBatis use a method that returned by it
49+
* </li>
50+
* <li>
51+
* If cannot resolve a method by {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver}(= not implement it or it was returned {@code null}),
52+
* the MyBatis will search and use a fallback method that named {@code provideSql} from specified type
53+
* </li>
54+
* </ul>
55+
*
56+
* @return a method name of method for providing an SQL
57+
*/
58+
String method() default "";
59+
3460
}

src/main/java/org/apache/ibatis/annotations/InsertProvider.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,33 @@
2828
@Retention(RetentionPolicy.RUNTIME)
2929
@Target(ElementType.METHOD)
3030
public @interface InsertProvider {
31+
32+
/**
33+
* Specify a type that implements an SQL provider method.
34+
*
35+
* @return a type that implements an SQL provider method
36+
*/
3137
Class<?> type();
3238

33-
String method();
39+
/**
40+
* Specify a method for providing an SQL.
41+
*
42+
* <p>
43+
* Since 3.5.1, this attribute can omit.
44+
* If this attribute omit, the MyBatis will call a method that decide by following rules.
45+
* <ul>
46+
* <li>
47+
* If class that specified the {@link #type()} attribute implements the {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver},
48+
* the MyBatis use a method that returned by it
49+
* </li>
50+
* <li>
51+
* If cannot resolve a method by {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver}(= not implement it or it was returned {@code null}),
52+
* the MyBatis will search and use a fallback method that named {@code provideSql} from specified type
53+
* </li>
54+
* </ul>
55+
*
56+
* @return a method name of method for providing an SQL
57+
*/
58+
String method() default "";
59+
3460
}

src/main/java/org/apache/ibatis/annotations/SelectProvider.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,33 @@
2828
@Retention(RetentionPolicy.RUNTIME)
2929
@Target(ElementType.METHOD)
3030
public @interface SelectProvider {
31+
32+
/**
33+
* Specify a type that implements an SQL provider method.
34+
*
35+
* @return a type that implements an SQL provider method
36+
*/
3137
Class<?> type();
3238

33-
String method();
39+
/**
40+
* Specify a method for providing an SQL.
41+
*
42+
* <p>
43+
* Since 3.5.1, this attribute can omit.
44+
* If this attribute omit, the MyBatis will call a method that decide by following rules.
45+
* <ul>
46+
* <li>
47+
* If class that specified the {@link #type()} attribute implements the {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver},
48+
* the MyBatis use a method that returned by it
49+
* </li>
50+
* <li>
51+
* If cannot resolve a method by {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver}(= not implement it or it was returned {@code null}),
52+
* the MyBatis will search and use a fallback method that named {@code provideSql} from specified type
53+
* </li>
54+
* </ul>
55+
*
56+
* @return a method name of method for providing an SQL
57+
*/
58+
String method() default "";
59+
3460
}

src/main/java/org/apache/ibatis/annotations/UpdateProvider.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,33 @@
2828
@Retention(RetentionPolicy.RUNTIME)
2929
@Target(ElementType.METHOD)
3030
public @interface UpdateProvider {
31+
32+
/**
33+
* Specify a type that implements an SQL provider method.
34+
*
35+
* @return a type that implements an SQL provider method
36+
*/
3137
Class<?> type();
3238

33-
String method();
39+
/**
40+
* Specify a method for providing an SQL.
41+
*
42+
* <p>
43+
* Since 3.5.1, this attribute can omit.
44+
* If this attribute omit, the MyBatis will call a method that decide by following rules.
45+
* <ul>
46+
* <li>
47+
* If class that specified the {@link #type()} attribute implements the {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver},
48+
* the MyBatis use a method that returned by it
49+
* </li>
50+
* <li>
51+
* If cannot resolve a method by {@link org.apache.ibatis.builder.annotation.ProviderMethodResolver}(= not implement it or it was returned {@code null}),
52+
* the MyBatis will search and use a fallback method that named {@code provideSql} from specified type
53+
* </li>
54+
* </ul>
55+
*
56+
* @return a method name of method for providing an SQL
57+
*/
58+
String method() default "";
59+
3460
}

src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,12 @@ public ResultMapping buildResultMapping(Class<?> resultType, String property, St
457457
nestedResultMap, notNullColumn, columnPrefix, typeHandler, flags, null, null, configuration.isLazyLoadingEnabled());
458458
}
459459

460+
/**
461+
* @deprecated Use {@link Configuration#getLanguageDriver(Class)}
462+
*/
463+
@Deprecated
460464
public LanguageDriver getLanguageDriver(Class<? extends LanguageDriver> langClass) {
461-
if (langClass != null) {
462-
configuration.getLanguageRegistry().register(langClass);
463-
} else {
464-
langClass = configuration.getLanguageRegistry().getDefaultDriverClass();
465-
}
466-
return configuration.getLanguageRegistry().getDriver(langClass);
465+
return configuration.getLanguageDriver(langClass);
467466
}
468467

469468
/** Backward compatibility signature. */

0 commit comments

Comments
 (0)