Skip to content

Commit 5da8e88

Browse files
authored
Merge pull request #2 from mybatis/master
update...
2 parents c9d829f + 4d7c029 commit 5da8e88

File tree

240 files changed

+5598
-1003
lines changed

Some content is hidden

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

240 files changed

+5598
-1003
lines changed

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ language: java
22

33
jdk:
44
- openjdk-ea
5+
- openjdk13
56
- openjdk12
6-
- oraclejdk11
7-
- oraclejdk8
7+
- openjdk11
8+
- openjdk8
89

910
services:
1011
- docker
@@ -24,3 +25,9 @@ env:
2425
global:
2526
- secure: "jWLfOryabB89R5v7nD3V/8ke6+B26UW8E5wjwKj7dDhjfmGUg+KbOShqWrq4\nEAnyE4GltwDLxKErZ5aAPWcT47C3GJYocKtmTcec2sblqMdVVUd3udylrM1d\n66Yb0XZoqri9JJ9pb8ObDp5XRV+ZQ5xP0w1gboNY6SynJg/1FKk="
2627
- secure: "UV14rAITDqou5jObPInlIS3IYdf45LihGal9/+C4TLyhXLaVktbT/arFAAIF\ndpv9OM+YgeA7ZeRZLJ8vbgipO+rxizPNL1DqK1rp9s5B2F2y9+ir47nTwayL\n0RN7TgdswjzZZKOukWF2CVK1hjk+n8iFkCrorU22trmXlHc0aoE="
28+
29+
addons:
30+
sonarcloud:
31+
organization: "mybatis"
32+
token:
33+
secure: "O1r6kWWgCPGgzw0L3yvC0J21p2ge3d6g80IfnFb1HYk46vd7XMNyqFnlPMLftLPEiC3R+f5u+tLWcRuutCCmRllbFuKgh++Jt0RZzfSm/xcdcr6V92zt8LQKIKJZH2hwalwzVQdI2xebdkltO2HyE+QVbhnpm9bQDklZKR7t1IQ="

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +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)
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/)
88
[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
99
[![Stack Overflow](http://img.shields.io/:stack%20overflow-mybatis-brightgreen.svg)](http://stackoverflow.com/questions/tagged/mybatis)
1010
[![Project Stats](https://www.openhub.net/p/mybatis/widgets/project_thin_badge.gif)](https://www.openhub.net/p/mybatis)

pom.xml

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

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

3333
<name>mybatis</name>
@@ -140,35 +140,35 @@
140140
<osgi.dynamicImport>*</osgi.dynamicImport>
141141
<spotbugs.onlyAnalyze>org.apache.ibatis.*</spotbugs.onlyAnalyze>
142142

143-
<!-- Remove after parent 32 (support for jdk 13) -->
144-
<jacoco.version>0.8.4</jacoco.version>
143+
<!-- Remove after parent 32 (support for jdk 13 and 14) -->
144+
<jacoco.version>0.8.5</jacoco.version>
145145
</properties>
146146

147147
<dependencies>
148148
<dependency>
149149
<groupId>ognl</groupId>
150150
<artifactId>ognl</artifactId>
151-
<version>3.2.10</version>
151+
<version>3.2.12</version>
152152
<scope>compile</scope>
153153
<optional>true</optional>
154154
</dependency>
155155
<dependency>
156156
<groupId>org.javassist</groupId>
157157
<artifactId>javassist</artifactId>
158-
<version>3.24.1-GA</version>
158+
<version>3.26.0-GA</version>
159159
<scope>compile</scope>
160160
<optional>true</optional>
161161
</dependency>
162162
<dependency>
163163
<groupId>org.slf4j</groupId>
164164
<artifactId>slf4j-api</artifactId>
165-
<version>1.7.26</version>
165+
<version>1.7.30</version>
166166
<optional>true</optional>
167167
</dependency>
168168
<dependency>
169169
<groupId>org.slf4j</groupId>
170170
<artifactId>slf4j-log4j12</artifactId>
171-
<version>1.7.26</version>
171+
<version>1.7.30</version>
172172
<optional>true</optional>
173173
</dependency>
174174
<dependency>
@@ -180,7 +180,7 @@
180180
<dependency>
181181
<groupId>org.apache.logging.log4j</groupId>
182182
<artifactId>log4j-core</artifactId>
183-
<version>2.11.2</version>
183+
<version>2.13.0</version>
184184
<optional>true</optional>
185185
</dependency>
186186
<dependency>
@@ -192,21 +192,21 @@
192192
<dependency>
193193
<groupId>cglib</groupId>
194194
<artifactId>cglib</artifactId>
195-
<version>3.2.10</version>
195+
<version>3.3.0</version>
196196
<optional>true</optional>
197197
</dependency>
198198

199199
<!-- Test dependencies -->
200200
<dependency>
201201
<groupId>org.junit.jupiter</groupId>
202202
<artifactId>junit-jupiter-engine</artifactId>
203-
<version>5.4.1</version>
203+
<version>5.5.2</version>
204204
<scope>test</scope>
205205
</dependency>
206206
<dependency>
207207
<groupId>org.hsqldb</groupId>
208208
<artifactId>hsqldb</artifactId>
209-
<version>2.4.1</version>
209+
<version>2.5.0</version>
210210
<scope>test</scope>
211211
</dependency>
212212
<dependency> <!-- 10.15+ need Java 9+ -->
@@ -218,62 +218,62 @@
218218
<dependency>
219219
<groupId>org.mockito</groupId>
220220
<artifactId>mockito-core</artifactId>
221-
<version>2.25.1</version>
221+
<version>3.2.4</version>
222222
<scope>test</scope>
223223
</dependency>
224224
<dependency>
225225
<groupId>org.mockito</groupId>
226226
<artifactId>mockito-junit-jupiter</artifactId>
227-
<version>2.25.1</version>
228-
<scope>test</scope>
229-
</dependency>
230-
<dependency>
231-
<groupId>org.apache.commons</groupId>
232-
<artifactId>commons-dbcp2</artifactId>
233-
<version>2.6.0</version>
234-
<scope>test</scope>
235-
</dependency>
236-
<dependency>
237-
<groupId>javax.transaction</groupId>
238-
<artifactId>javax.transaction-api</artifactId>
239-
<version>1.3</version>
227+
<version>3.2.4</version>
240228
<scope>test</scope>
241229
</dependency>
242230
<dependency>
243231
<groupId>org.apache.velocity</groupId>
244232
<artifactId>velocity-engine-core</artifactId>
245-
<version>2.0</version>
233+
<version>2.1</version>
246234
<scope>test</scope>
247235
</dependency>
248236
<!-- postgresql driver is required to run the refcursor tests -->
249237
<dependency>
250238
<groupId>org.postgresql</groupId>
251239
<artifactId>postgresql</artifactId>
252-
<version>42.2.5</version>
240+
<version>42.2.9</version>
241+
<scope>test</scope>
242+
</dependency>
243+
<dependency>
244+
<groupId>mysql</groupId>
245+
<artifactId>mysql-connector-java</artifactId>
246+
<version>8.0.18</version>
253247
<scope>test</scope>
254248
</dependency>
255249
<dependency>
256250
<groupId>org.assertj</groupId>
257251
<artifactId>assertj-core</artifactId>
258-
<version>3.12.2</version>
252+
<version>3.14.0</version>
259253
<scope>test</scope>
260254
</dependency>
261255
<dependency>
262256
<groupId>eu.codearte.catch-exception</groupId>
263257
<artifactId>catch-exception</artifactId>
264-
<version>1.4.6</version>
258+
<version>2.0</version>
265259
<scope>test</scope>
266260
</dependency>
267261
<dependency>
268262
<groupId>org.testcontainers</groupId>
269263
<artifactId>junit-jupiter</artifactId>
270-
<version>1.11.2</version>
264+
<version>1.12.4</version>
271265
<scope>test</scope>
272266
</dependency>
273267
<dependency>
274268
<groupId>org.testcontainers</groupId>
275269
<artifactId>postgresql</artifactId>
276-
<version>1.11.2</version>
270+
<version>1.12.4</version>
271+
<scope>test</scope>
272+
</dependency>
273+
<dependency>
274+
<groupId>org.testcontainers</groupId>
275+
<artifactId>mysql</artifactId>
276+
<version>1.12.4</version>
277277
<scope>test</scope>
278278
</dependency>
279279
</dependencies>

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

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2018 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.
@@ -16,6 +16,8 @@
1616
package org.apache.ibatis.annotations;
1717

1818
import java.lang.annotation.Documented;
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Repeatable;
1921
import java.lang.annotation.Retention;
2022
import java.lang.annotation.RetentionPolicy;
2123
import java.lang.annotation.Target;
@@ -25,29 +27,78 @@
2527
import org.apache.ibatis.type.UnknownTypeHandler;
2628

2729
/**
30+
* The annotation that specify a mapping definition for the constructor argument.
31+
*
32+
* @see ConstructorArgs
2833
* @author Clinton Begin
2934
*/
3035
@Documented
3136
@Retention(RetentionPolicy.RUNTIME)
32-
@Target({})
37+
@Target(ElementType.METHOD)
38+
@Repeatable(ConstructorArgs.class)
3339
public @interface Arg {
40+
41+
/**
42+
* Returns whether id column or not.
43+
*
44+
* @return {@code true} if id column; {@code false} if otherwise
45+
*/
3446
boolean id() default false;
3547

48+
/**
49+
* Return the column name(or column label) to map to this argument.
50+
*
51+
* @return the column name(or column label)
52+
*/
3653
String column() default "";
3754

55+
/**
56+
* Return the java type for this argument.
57+
*
58+
* @return the java type
59+
*/
3860
Class<?> javaType() default void.class;
3961

62+
/**
63+
* Return the jdbc type for column that map to this argument.
64+
*
65+
* @return the jdbc type
66+
*/
4067
JdbcType jdbcType() default JdbcType.UNDEFINED;
4168

69+
/**
70+
* Returns the {@link TypeHandler} type for retrieving a column value from result set.
71+
*
72+
* @return the {@link TypeHandler} type
73+
*/
4274
Class<? extends TypeHandler> typeHandler() default UnknownTypeHandler.class;
4375

76+
/**
77+
* Return the statement id for retrieving a object that map to this argument.
78+
*
79+
* @return the statement id
80+
*/
4481
String select() default "";
4582

83+
/**
84+
* Returns the result map id for mapping to a object that map to this argument.
85+
*
86+
* @return the result map id
87+
*/
4688
String resultMap() default "";
4789

90+
/**
91+
* Returns the parameter name for applying this mapping.
92+
*
93+
* @return the parameter name
94+
* @since 3.4.3
95+
*/
4896
String name() default "";
4997

5098
/**
99+
* Returns the column prefix that use when applying {@link #resultMap()}.
100+
*
101+
* @return the column prefix
51102
* @since 3.5.0
52103
*/
53104
String columnPrefix() default "";

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2017 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.
@@ -24,6 +24,26 @@
2424
/**
2525
* The marker annotation that indicate a constructor for automatic mapping.
2626
*
27+
* <p><br>
28+
* <b>How to use:</b>
29+
* <pre>
30+
* public class User {
31+
*
32+
* private int id;
33+
* private String name;
34+
*
35+
* public User(int id) {
36+
* this.id = id;
37+
* }
38+
*
39+
* &#064;AutomapConstructor
40+
* public User(int id, String name) {
41+
* this.id = id;
42+
* this.name = name;
43+
* }
44+
* // ...
45+
* }
46+
* </pre>
2747
* @author Tim Chen
2848
* @since 3.4.3
2949
*/

0 commit comments

Comments
 (0)