Skip to content

Commit 4df7342

Browse files
committed
Merge branch 'master' into feature/mybatis-benchmarks-setup
2 parents f8d25aa + e9e9a29 commit 4df7342

File tree

6 files changed

+43
-40
lines changed

6 files changed

+43
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, macos-latest, windows-latest]
11-
java: [11, 17, 21, 22-ea, 23-ea]
11+
java: [11, 17, 21, 22, 23-ea]
1212
distribution: ['temurin']
1313
fail-fast: false
1414
max-parallel: 4

.github/workflows/sonatype.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
java-version: 21
1818
distribution: zulu
1919
- name: Deploy to Sonatype
20-
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true
20+
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true -Prelease -Dgpg.skip
2121
env:
2222
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
2323
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<groupId>org.mybatis</groupId>
3030
<artifactId>mybatis</artifactId>
31-
<version>3.5.16-SNAPSHOT</version>
31+
<version>3.5.17-SNAPSHOT</version>
3232

3333
<name>mybatis</name>
3434
<description>The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented
@@ -131,7 +131,7 @@
131131
<properties>
132132
<clirr.comparisonVersion>3.4.6</clirr.comparisonVersion>
133133

134-
<byte-buddy.version>1.14.12</byte-buddy.version>
134+
<byte-buddy.version>1.14.13</byte-buddy.version>
135135
<derby.version>10.17.1.0</derby.version>
136136
<log4j.version>2.23.1</log4j.version>
137137
<mockito.version>5.11.0</mockito.version>
@@ -159,7 +159,7 @@
159159
<argLine>-Xmx2048m -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar</argLine>
160160

161161
<!-- Reproducible Builds -->
162-
<project.build.outputTimestamp>1702533513</project.build.outputTimestamp>
162+
<project.build.outputTimestamp>1712079482</project.build.outputTimestamp>
163163
</properties>
164164

165165
<dependencies>
@@ -324,7 +324,7 @@
324324
<dependency>
325325
<groupId>commons-logging</groupId>
326326
<artifactId>commons-logging</artifactId>
327-
<version>1.3.0</version>
327+
<version>1.3.1</version>
328328
<optional>true</optional>
329329
</dependency>
330330
<dependency>
@@ -336,15 +336,15 @@
336336
<dependency>
337337
<groupId>org.slf4j</groupId>
338338
<artifactId>slf4j-api</artifactId>
339-
<version>2.0.12</version>
339+
<version>2.0.13</version>
340340
<optional>true</optional>
341341
</dependency>
342342

343343
<!-- Logging Support used in testing -->
344344
<dependency>
345345
<groupId>ch.qos.logback</groupId>
346346
<artifactId>logback-classic</artifactId>
347-
<version>1.5.3</version>
347+
<version>1.5.5</version>
348348
<scope>test</scope>
349349
</dependency>
350350
<dependency>

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

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -26,33 +26,33 @@
2626
* The annotation that specify an SQL for retrieving record(s).
2727
* <p>
2828
* <b>How to use:</b>
29-
* <br/>
29+
* <p>
3030
* <ul>
31-
* <li>
32-
* Simple:
33-
* <pre>
34-
* public interface UserMapper {
35-
* &#064;Select("SELECT id, name FROM users WHERE id = #{id}")
36-
* User selectById(int id);
37-
* }
38-
* </pre>
39-
* </li>
40-
* <li>
41-
* Dynamic SQL:
42-
* <pre>
43-
* public interface UserMapper {
44-
* &#064;Select({"&lt;script>",
45-
* "select * from users",
46-
* "where name = #{name}",
47-
* "&lt;if test=\"age != null\"> age = #{age} &lt;/if>",
48-
* "&lt;/script>"})
49-
* User select(@NotNull String name, @Nullable Intger age);
50-
* }
51-
* </pre>
52-
* </li>
31+
* <li>Simple:
32+
*
33+
* <pre>{@code
34+
* public interface UserMapper {
35+
* @Select("SELECT id, name FROM users WHERE id = #{id}")
36+
* User selectById(int id);
37+
* }
38+
* }</pre>
39+
*
40+
* </li>
41+
* <li>Dynamic SQL:
42+
*
43+
* <pre>{@code
44+
* public interface UserMapper {
45+
* @Select({ "<script>", "select * from users", "where name = #{name}",
46+
* "<if test=\"age != null\"> age = #{age} </if>", "</script>" })
47+
* User select(@NotNull String name, @Nullable Intger age);
48+
* }
49+
* }</pre>
50+
*
51+
* </li>
5352
* </ul>
5453
*
5554
* @author Clinton Begin
55+
*
5656
* @see <a href="https://mybatis.org/mybatis-3/dynamic-sql.html">How to use Dynamic SQL</a>
5757
*/
5858
@Documented
@@ -69,6 +69,7 @@
6969

7070
/**
7171
* @return A database id that correspond this statement
72+
*
7273
* @since 3.5.5
7374
*/
7475
String databaseId() default "";
@@ -78,6 +79,7 @@
7879
* e.g. RETURNING of PostgreSQL or OUTPUT of MS SQL Server.
7980
*
8081
* @return {@code true} if this select affects DB data; {@code false} if otherwise
82+
*
8183
* @since 3.5.12
8284
*/
8385
boolean affectData() default false;
@@ -86,6 +88,7 @@
8688
* The container annotation for {@link Select}.
8789
*
8890
* @author Kazuki Shimizu
91+
*
8992
* @since 3.5.5
9093
*/
9194
@Documented

src/main/java/org/apache/ibatis/executor/keygen/SelectKeyGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void processGeneratedKeys(Executor executor, MappedStatement ms, Object
6565
// The transaction will be closed by parent executor.
6666
Executor keyExecutor = configuration.newExecutor(executor.getTransaction(), ExecutorType.SIMPLE);
6767
List<Object> values = keyExecutor.query(keyStatement, parameter, RowBounds.DEFAULT, Executor.NO_RESULT_HANDLER);
68-
if (values.size() == 0) {
68+
if (values.isEmpty()) {
6969
throw new ExecutorException("SelectKey returned no data.");
7070
}
7171
if (values.size() > 1) {

src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -18,13 +18,14 @@
1818
import java.io.Reader;
1919
import java.util.concurrent.ExecutorService;
2020
import java.util.concurrent.Executors;
21+
import java.util.concurrent.TimeUnit;
2122

2223
import org.apache.ibatis.BaseDataTest;
2324
import org.apache.ibatis.io.Resources;
2425
import org.apache.ibatis.session.SqlSession;
2526
import org.apache.ibatis.session.SqlSessionFactory;
2627
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
27-
import org.junit.jupiter.api.Assertions;
28+
import org.assertj.core.api.Assertions;
2829
import org.junit.jupiter.api.BeforeEach;
2930
import org.junit.jupiter.api.Test;
3031

@@ -47,7 +48,7 @@ void setUp() throws Exception {
4748
}
4849

4950
@Test
50-
void testBlockingCache() {
51+
void testBlockingCache() throws InterruptedException {
5152
ExecutorService defaultThreadPool = Executors.newFixedThreadPool(2);
5253

5354
long init = System.currentTimeMillis();
@@ -57,13 +58,12 @@ void testBlockingCache() {
5758
}
5859

5960
defaultThreadPool.shutdown();
60-
61-
while (!defaultThreadPool.isTerminated()) {
62-
continue;
61+
if (!defaultThreadPool.awaitTermination(5, TimeUnit.SECONDS)) {
62+
defaultThreadPool.shutdownNow();
6363
}
6464

6565
long totalTime = System.currentTimeMillis() - init;
66-
Assertions.assertTrue(totalTime > 1000);
66+
Assertions.assertThat(totalTime).isGreaterThanOrEqualTo(1000);
6767
}
6868

6969
private void accessDB() {

0 commit comments

Comments
 (0)