Skip to content

Commit 45716cf

Browse files
committed
Merge branch 'master' into feat/2618-auto-determine-type-when-missing
2 parents 2c20337 + 48242f5 commit 45716cf

File tree

18 files changed

+79
-23
lines changed

18 files changed

+79
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/release.properties
1111
/target
1212
.github/keys/
13+
.profiler/
1314

1415
# These are needed if running in IDE without properties set
1516
/ibderby

.mvn/extensions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
-->
1919
<extensions>
20+
<!-- Usage as -Dprofile -->
2021
<extension>
2122
<groupId>fr.jcgay.maven</groupId>
2223
<artifactId>maven-profiler</artifactId>

hooks/pre-commit.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2009-2025 the original author or authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
set -eo pipefail
18+
19+
function format_and_sort() {
20+
# Run the validate and import check commands, suppressing all output and errors
21+
if ! mvn formatter:validate impsort:check > /dev/null 2>&1; then
22+
# If validation failed, fix it by ensuring code is formatted correctly
23+
# and that imports are sorted as some IDEs automatically change it on save
24+
mvn formatter:format impsort:sort
25+
26+
# Fail the commit, so the author can re-select what to commit
27+
echo "Formatting and/or import sorting were required. Please check and make another commit."
28+
exit 1
29+
fi
30+
31+
# If no error occurred, print a success message
32+
echo "All files are properly formatted and imports are sorted."
33+
}
34+
35+
format_and_sort

pom.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
<mockito.version>5.15.2</mockito.version>
7979
<mssql-jdbc.version>12.8.1.jre11</mssql-jdbc.version>
8080
<testcontainers.version>1.20.4</testcontainers.version>
81+
<git-build-hook.version>3.5.0</git-build-hook.version>
8182

8283
<!-- Add slow test groups here and annotate classes similar to @Tag('groupName'). -->
8384
<!-- Excluded groups are ran on github ci, to force here, pass -d"excludedGroups=" -->
@@ -195,7 +196,7 @@
195196
<dependency>
196197
<groupId>org.postgresql</groupId>
197198
<artifactId>postgresql</artifactId>
198-
<version>42.7.4</version>
199+
<version>42.7.5</version>
199200
<scope>test</scope>
200201
</dependency>
201202
<dependency>
@@ -431,6 +432,24 @@
431432
</rules>
432433
</configuration>
433434
</plugin>
435+
436+
<plugin>
437+
<groupId>com.rudikershaw.gitbuildhook</groupId>
438+
<artifactId>git-build-hook-maven-plugin</artifactId>
439+
<version>${git-build-hook.version}</version>
440+
<configuration>
441+
<installHooks>
442+
<pre-commit>hooks/pre-commit.sh</pre-commit>
443+
</installHooks>
444+
</configuration>
445+
<executions>
446+
<execution>
447+
<goals>
448+
<goal>install</goal>
449+
</goals>
450+
</execution>
451+
</executions>
452+
</plugin>
434453
</plugins>
435454
</build>
436455

src/test/java/org/apache/ibatis/binding/BindingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ void shouldCacheMapperMethod() throws Exception {
623623
void shouldGetBlogsWithAuthorsAndPosts() {
624624
try (SqlSession session = sqlSessionFactory.openSession()) {
625625
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
626-
List<Blog> blogs = mapper.selectBlogsWithAutorAndPosts();
626+
List<Blog> blogs = mapper.selectBlogsWithAuthorAndPosts();
627627
assertEquals(2, blogs.size());
628628
assertTrue(blogs.get(0) instanceof Proxy);
629629
assertEquals(101, blogs.get(0).getAuthor().getId());
@@ -640,7 +640,7 @@ void shouldGetBlogsWithAuthorsAndPosts() {
640640
void shouldGetBlogsWithAuthorsAndPostsEagerly() {
641641
try (SqlSession session = sqlSessionFactory.openSession()) {
642642
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
643-
List<Blog> blogs = mapper.selectBlogsWithAutorAndPostsEagerly();
643+
List<Blog> blogs = mapper.selectBlogsWithAuthorAndPostsEagerly();
644644
assertEquals(2, blogs.size());
645645
assertFalse(blogs.get(0) instanceof Factory);
646646
assertEquals(101, blogs.get(0).getAuthor().getId());

src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Blog selectBlogWithAParamNamedValue(@Param("column") String column, @Param("id")
251251
@Result(property = "posts", column = "id", many = @Many(select = "selectPostsById"))
252252
})
253253
// @formatter:on
254-
List<Blog> selectBlogsWithAutorAndPosts();
254+
List<Blog> selectBlogsWithAuthorAndPosts();
255255

256256
// @formatter:off
257257
@Select({
@@ -263,6 +263,6 @@ Blog selectBlogWithAParamNamedValue(@Param("column") String column, @Param("id")
263263
@Result(property = "posts", column = "id", many = @Many(select = "selectPostsById", fetchType = FetchType.EAGER))
264264
})
265265
// @formatter:on
266-
List<Blog> selectBlogsWithAutorAndPostsEagerly();
266+
List<Blog> selectBlogsWithAuthorAndPostsEagerly();
267267

268268
}

src/test/java/org/apache/ibatis/executor/loader/CglibProxyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void shouldLetCallALoadedProperty() {
7171
}
7272

7373
@Test
74-
void shouldSerizalizeADeserlizaliedProxy() throws Exception {
74+
void shouldSerializeADeserializedProxy() throws Exception {
7575
Object proxy = ((CglibProxyFactory) proxyFactory).createDeserializationProxy(author, new HashMap<>(),
7676
new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>());
7777
Author author2 = (Author) deserialize(serialize((Serializable) proxy));

src/test/java/org/apache/ibatis/executor/loader/JavassistProxyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void shouldLetCallALoadedProperty() {
6969
}
7070

7171
@Test
72-
void shouldSerizalizeADeserlizaliedProxy() throws Exception {
72+
void shouldSerializeADeserializedProxy() throws Exception {
7373
Object proxy = ((JavassistProxyFactory) proxyFactory).createDeserializationProxy(author, new HashMap<>(),
7474
new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>());
7575
Author author2 = (Author) deserialize(serialize((Serializable) proxy));

src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void shouldSerializeAProxyForABeanWithoutDefaultConstructorAndUnloadedProperties
110110
}
111111

112112
@Test
113-
void shouldSerizaliceAFullLoadedObjectToOriginalClass() throws Exception {
113+
void shouldSerializeAFullLoadedObjectToOriginalClass() throws Exception {
114114
Object proxy = proxyFactory.createProxy(author, new ResultLoaderMap(), new Configuration(),
115115
new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>());
116116
Object proxy2 = deserialize(serialize((Serializable) proxy));

src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void getConfiguredTemplate() {
9191
templateName = ExternalResources.getConfiguredTemplate(tempFile.getAbsolutePath(), "new_command.template");
9292
assertEquals("templates/col_new_template_migration.sql", templateName);
9393
} catch (Exception e) {
94-
fail("Test failed with execption: " + e.getMessage());
94+
fail("Test failed with exception: " + e.getMessage());
9595
}
9696
}
9797

0 commit comments

Comments
 (0)