Skip to content

Commit baa1316

Browse files
authored
Merge pull request mybatis#177 from pboonphong/2.0.x
mybatis-spring-2.0.x (Java 8 and Spring 5.x)
2 parents 4b63249 + 41347e2 commit baa1316

File tree

66 files changed

+969
-779
lines changed

Some content is hidden

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

66 files changed

+969
-779
lines changed

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ sudo: false
33

44
jdk:
55
- oraclejdk8
6-
- oraclejdk7
7-
- openjdk7
8-
- openjdk6
96

107
after_success:
118
- chmod -R 777 ./travis/after_success.sh

pom.xml

+82-24
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@
2323
<groupId>org.mybatis</groupId>
2424
<artifactId>mybatis-parent</artifactId>
2525
<version>28</version>
26-
<relativePath />
26+
<relativePath/>
2727
</parent>
2828

2929
<artifactId>mybatis-spring</artifactId>
30-
<version>1.3.2-SNAPSHOT</version>
30+
<version>2.0.0-SNAPSHOT</version>
3131
<packaging>jar</packaging>
3232

3333
<name>mybatis-spring</name>
3434
<description>An easy-to-use Spring bridge for MyBatis sql mapping framework.</description>
3535
<url>http://www.mybatis.org/spring/</url>
3636

3737
<contributors>
38-
3938
<contributor>
4039
<name>Alex Rykov</name>
4140
<email>[email protected]</email>
4241
</contributor>
43-
42+
4443
<contributor>
4544
<name>Andrius Juozapaitis</name>
4645
<email>[email protected]</email>
@@ -103,9 +102,22 @@
103102
<clirr.comparisonVersion>1.2.2</clirr.comparisonVersion>
104103
<findbugs.onlyAnalyze>org.mybatis.spring.*,org.mybatis.spring.mapper.*,org.mybatis.spring.support.*,org.mybatis.spring.transaction.*</findbugs.onlyAnalyze>
105104
<gcu.product>Spring</gcu.product>
105+
<maven.compiler.source>1.8</maven.compiler.source>
106+
<maven.compiler.target>1.8</maven.compiler.target>
107+
<maven.compiler.testSource>1.8</maven.compiler.testSource>
108+
<maven.compiler.testTarget>1.8</maven.compiler.testTarget>
106109
<osgi.import>org.springframework.batch.*;resolution:=optional,*</osgi.import>
107110
<osgi.dynamicImport>*</osgi.dynamicImport>
108-
<spring.version>4.3.8.RELEASE</spring.version>
111+
112+
<spring.version>5.0.0.M5</spring.version>
113+
<spring-batch.version>4.0.0.M1</spring-batch.version>
114+
<junit-platform.version>1.0.0-M4</junit-platform.version>
115+
<junit.version>5.0.0-M4</junit.version>
116+
117+
<!-- Override: Animal Sniffer Signature -->
118+
<signature.group>org.codehaus.mojo.signature</signature.group>
119+
<signature.artifact>java18</signature.artifact>
120+
<signature.version>1.0</signature.version>
109121
</properties>
110122

111123
<dependencies>
@@ -133,7 +145,7 @@
133145
<dependency>
134146
<groupId>org.springframework.batch</groupId>
135147
<artifactId>spring-batch-infrastructure</artifactId>
136-
<version>3.0.7.RELEASE</version>
148+
<version>4.0.0.M1</version>
137149
<scope>provided</scope>
138150
</dependency>
139151

@@ -143,24 +155,37 @@
143155
<dependency>
144156
<groupId>com.atomikos</groupId>
145157
<artifactId>transactions-jdbc</artifactId>
146-
<version>4.0.3</version>
158+
<version>4.0.4</version>
147159
<scope>test</scope>
148160
</dependency>
149161

150162
<dependency>
151163
<groupId>org.apache.derby</groupId>
152164
<artifactId>derby</artifactId>
153-
<version>10.12.1.1</version>
165+
<version>10.13.1.1</version>
166+
<scope>test</scope>
167+
</dependency>
168+
169+
<dependency>
170+
<groupId>org.junit.jupiter</groupId>
171+
<artifactId>junit-jupiter-api</artifactId>
172+
<version>5.0.0-M4</version>
154173
<scope>test</scope>
155174
</dependency>
156175

157176
<dependency>
158-
<groupId>junit</groupId>
159-
<artifactId>junit</artifactId>
160-
<version>4.12</version>
177+
<groupId>org.junit.jupiter</groupId>
178+
<artifactId>junit-jupiter-engine</artifactId>
179+
<version>${junit.version}</version>
161180
<scope>test</scope>
162181
</dependency>
163182

183+
<dependency>
184+
<groupId>org.junit.platform</groupId>
185+
<artifactId>junit-platform-runner</artifactId>
186+
<version>${junit-platform.version}</version>
187+
</dependency>
188+
164189
<dependency>
165190
<groupId>org.jboss.byteman</groupId>
166191
<artifactId>byteman-bmunit</artifactId>
@@ -196,20 +221,32 @@
196221
<scope>test</scope>
197222
</dependency>
198223

224+
<dependency>
225+
<groupId>org.mockito</groupId>
226+
<artifactId>mockito-core</artifactId>
227+
<version>2.7.22</version>
228+
</dependency>
229+
230+
<dependency>
231+
<groupId>org.assertj</groupId>
232+
<artifactId>assertj-core</artifactId>
233+
<version>3.6.2</version>
234+
</dependency>
235+
199236
<!-- Using version 1.0.1, versions higher require only jdk7 -->
200237
<dependency>
201238
<groupId>com.mockrunner</groupId>
202239
<artifactId>mockrunner-core</artifactId>
203-
<version>1.0.1</version>
240+
<version>1.1.2</version>
204241
<scope>test</scope>
205242
<exclusions>
206243
<exclusion>
207-
<groupId>commons-logging</groupId>
208-
<artifactId>commons-logging</artifactId>
244+
<groupId>commons-logging</groupId>
245+
<artifactId>commons-logging</artifactId>
209246
</exclusion>
210247
<exclusion>
211-
<groupId>com.kirkk</groupId>
212-
<artifactId>jaranalyzer</artifactId>
248+
<groupId>com.kirkk</groupId>
249+
<artifactId>jaranalyzer</artifactId>
213250
</exclusion>
214251
<exclusion>
215252
<groupId>jdom</groupId>
@@ -224,7 +261,7 @@
224261
<dependency>
225262
<groupId>com.mockrunner</groupId>
226263
<artifactId>mockrunner-ejb</artifactId>
227-
<version>1.0.1</version>
264+
<version>1.1.2</version>
228265
<scope>test</scope>
229266
<exclusions>
230267
<exclusion>
@@ -240,28 +277,38 @@
240277
<dependency>
241278
<groupId>com.mockrunner</groupId>
242279
<artifactId>mockrunner-jdbc</artifactId>
243-
<version>1.0.1</version>
280+
<version>1.1.2</version>
244281
<scope>test</scope>
245282
</dependency>
246283

247284
<dependency>
248285
<groupId>javax.transaction</groupId>
249-
<artifactId>transaction-api</artifactId>
250-
<version>1.1</version>
286+
<artifactId>javax.transaction-api</artifactId>
287+
<version>1.2</version>
251288
<scope>test</scope>
252289
</dependency>
253290
<dependency>
254291
<groupId>javax.servlet</groupId>
255292
<artifactId>javax.servlet-api</artifactId>
256-
<version>3.0.1</version>
293+
<version>3.1.0</version>
257294
<scope>test</scope>
258295
</dependency>
259296

260297
</dependencies>
261298

299+
<repositories>
300+
<repository>
301+
<id>spring-milestones</id>
302+
<name>Spring Milestones</name>
303+
<url>https://repo.spring.io/libs-milestone</url>
304+
<snapshots>
305+
<enabled>false</enabled>
306+
</snapshots>
307+
</repository>
308+
</repositories>
309+
262310
<build>
263311
<plugins>
264-
265312
<plugin>
266313
<groupId>org.apache.maven.plugins</groupId>
267314
<artifactId>maven-surefire-plugin</artifactId>
@@ -275,10 +322,21 @@
275322
<name>com.atomikos.icatch.log_base_dir</name>
276323
<value>${project.build.directory}</value>
277324
</property>
278-
</systemProperties>
325+
</systemProperties>
279326
</configuration>
327+
<dependencies>
328+
<dependency>
329+
<groupId>org.junit.platform</groupId>
330+
<artifactId>junit-platform-surefire-provider</artifactId>
331+
<version>${junit-platform.version}</version>
332+
</dependency>
333+
<dependency>
334+
<groupId>org.junit.jupiter</groupId>
335+
<artifactId>junit-jupiter-engine</artifactId>
336+
<version>${junit.version}</version>
337+
</dependency>
338+
</dependencies>
280339
</plugin>
281-
282340
<plugin>
283341
<groupId>org.apache.maven.plugins</groupId>
284342
<artifactId>maven-site-plugin</artifactId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/**
2+
* Copyright 2010-2017 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.mybatis.logging;
17+
18+
import org.apache.ibatis.logging.Log;
19+
20+
import java.util.function.Supplier;
21+
22+
/**
23+
* Wrapper of {@link Log}, allow log with lambda expressions.
24+
*
25+
* @author Putthiphong Boonphong
26+
*/
27+
public class Logger {
28+
29+
private Log log;
30+
31+
Logger(Log log) {
32+
this.log = log;
33+
}
34+
35+
public void error(Supplier<String> s, Throwable e) {
36+
log.error(s.get(), e);
37+
}
38+
39+
public void error(Supplier<String> s) {
40+
log.error(s.get());
41+
}
42+
43+
public void warn(Supplier<String> s) {
44+
log.warn(s.get());
45+
}
46+
47+
public void debug(Supplier<String> s) {
48+
if (log.isDebugEnabled()) {
49+
log.debug(s.get());
50+
}
51+
}
52+
53+
public void trace(Supplier<String> s) {
54+
if (log.isTraceEnabled()) {
55+
log.trace(s.get());
56+
}
57+
}
58+
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright 2010-2017 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.mybatis.logging;
17+
18+
import org.apache.ibatis.logging.LogFactory;
19+
20+
/**
21+
* LoggerFactory is a wrapper around {@link LogFactory} to support {@link Logger}.
22+
*
23+
* @author Putthiphong Boonphong
24+
*/
25+
public class LoggerFactory {
26+
27+
public static Logger getLogger(Class<?> aClass) {
28+
return new Logger(LogFactory.getLog(aClass));
29+
}
30+
31+
public static Logger getLogger(String logger) {
32+
return new Logger(LogFactory.getLog(logger));
33+
}
34+
35+
}

0 commit comments

Comments
 (0)