Skip to content

Commit adab6dc

Browse files
committed
Bump mybatis to 3.5.19
3.1.1 is from 2012. 3.5.19 is the last Java 8 release of the 3.5 line. 3.6.0 is only days old, so this stays on 3.5. OGNL and javassist are still shaded inside the mybatis jar, and nothing else is needed at runtime. The 3.5 line binds a simple parameterType's type handler from the declared type. User.selectPreferencesForUser declared java.lang.String but is called with the Integer user id, so it now declares java.lang.Integer in every database's mapper. Upstream Mirth made the same change when it moved to 3.5.15. DebugUsage.getDebugUsageStatistics and deleteDebugUsageStatistics declared java.lang.String but are called with a DebugUsage, so they now declare that class; they worked either way, because the serverId property they read is a String. The other String and Integer parameterTypes match what their callers pass. MyBatis stopped logging SQL under the java.sql loggers in 3.2 and logs each statement under its own ID instead, so the java.sql entry in log4j2.properties had no effect any more. logPrefix is now set, so every statement logs under mybatis.<namespace>.<id>, and that entry now names mybatis, so one logger still controls all SQL logging. The comments there now explain how to log a single namespace and warn that DEBUG and TRACE can write sensitive data to the logs. THIRD-PARTY-README lists the OGNL 3.4.4 and Javassist 3.30.2-GA copies bundled inside the jar. OGNL 3.4.4 is Apache 2.0, and the 2004 BSD notice stays because the MyBatis NOTICE file reproduces it. mybatis-parent 15 was only the parent of 3.1.1, so its checksum entry is replaced by mybatis-parent 48, the parent of 3.5.19. Signed-off-by: Nico Piel <nicopiel@mailbox.org> Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Tony Germano <tony@germano.name>
1 parent 8821c16 commit adab6dc

15 files changed

Lines changed: 48 additions & 28 deletions

‎gradle/libs.versions.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ mimepull = { module = "org.jvnet.mimepull:mimepull", version = "1.9.7" }
216216
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
217217
mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "mockito" }
218218
mssql-jdbc = { module = "com.microsoft.sqlserver:mssql-jdbc", version = "10.2.4.jre11" }
219-
mybatis = { module = "org.mybatis:mybatis", version = "3.1.1" }
219+
mybatis = { module = "org.mybatis:mybatis", version = "3.5.19" }
220220
mysql-connector-j = { module = "com.mysql:mysql-connector-j", version = "8.4.0" }
221221
netty-buffer = { module = "io.netty:netty-buffer", version.ref = "netty" }
222222
netty-codec = { module = "io.netty:netty-codec", version.ref = "netty" }

‎gradle/verification-metadata.xml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,17 +2786,17 @@
27862786
<sha256 value="75f51406de4eb508b7614de4f2b447447570d1f63dbd90c59d87655e3681e2f2" origin="Generated by Gradle"/>
27872787
</artifact>
27882788
</component>
2789-
<component group="org.mybatis" name="mybatis" version="3.1.1">
2790-
<artifact name="mybatis-3.1.1.jar">
2791-
<sha256 value="3d5561088062ba69fa8865add891dcb856600fbfa255f28504c370503108afb6" origin="Generated by Gradle"/>
2789+
<component group="org.mybatis" name="mybatis" version="3.5.19">
2790+
<artifact name="mybatis-3.5.19.jar">
2791+
<sha256 value="93eea616ae355751bd5fbabb57f0732713fbe79f3196f33c51a0aeeb4255862a" origin="Generated by Gradle"/>
27922792
</artifact>
2793-
<artifact name="mybatis-3.1.1.pom">
2794-
<sha256 value="f68d654f21587b5446b888000c56846750fa3ac1ec10788ef23ec181057b4a95" origin="Generated by Gradle"/>
2793+
<artifact name="mybatis-3.5.19.pom">
2794+
<sha256 value="3e70093e8a67a7584154fd78b8c3846d742d9520b679b337429136dcad4ba271" origin="Generated by Gradle"/>
27952795
</artifact>
27962796
</component>
2797-
<component group="org.mybatis" name="mybatis-parent" version="15">
2798-
<artifact name="mybatis-parent-15.pom">
2799-
<sha256 value="26a6acf683388b150774143fae3b3887657858ca133703e523888b575067db61" origin="Generated by Gradle"/>
2797+
<component group="org.mybatis" name="mybatis-parent" version="48">
2798+
<artifact name="mybatis-parent-48.pom">
2799+
<sha256 value="36de4474dadcac931e24f8ead7c6bdd39a4232e02205201c1991e215d45371e4" origin="Generated by Gradle"/>
28002800
</artifact>
28012801
</component>
28022802
<component group="org.objenesis" name="objenesis" version="2.5.1">

‎server/conf/log4j2.properties‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,17 @@ logger.shutdown.name = shutdown
6363
logger.shutdown.level = DEBUG
6464

6565
# SQL Logging
66-
logger.sql.name = java.sql
66+
# MyBatis logs each statement under mybatis.<namespace>.<statement ID>.
67+
# DEBUG logs the SQL and its parameters; TRACE also logs every row returned.
68+
# To log only one namespace, leave logger.sql at ERROR and add a logger for
69+
# that namespace, for example:
70+
# logger.sqlMessage.name = mybatis.Message
71+
# logger.sqlMessage.level = DEBUG
72+
# Core namespaces: Alert, Channel, CodeTemplate, Configuration, DebugUsage,
73+
# Event, Message, Script, User. Plugins may add their own.
74+
# WARNING: at DEBUG or TRACE, the logged parameters and rows can include
75+
# message content (which may contain PHI), channel and server configuration
76+
# (including passwords stored in it), and user credential hashes. Enable it
77+
# only while troubleshooting, and protect or delete the resulting logs.
78+
logger.sql.name = mybatis
6779
logger.sql.level = ERROR

‎server/dbconf/SqlMapConfig.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<settings>
66
<setting name="cacheEnabled" value="true" />
77
<setting name="jdbcTypeForNull" value="VARCHAR" />
8+
<setting name="logPrefix" value="mybatis." />
89
</settings>
910

1011
<typeAliases>

‎server/dbconf/derby/derby-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/derby/derby-user.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
{call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'PERSON', 0)}
155155
</select>
156156

157-
<select id='selectPreferencesForUser' parameterType='java.lang.String' resultType='KeyValuePair'>
157+
<select id='selectPreferencesForUser' parameterType='java.lang.Integer' resultType='KeyValuePair'>
158158
SELECT NAME AS "key", VALUE AS "value"
159159
FROM PERSON_PREFERENCE
160160
WHERE PERSON_ID = #{value}

‎server/dbconf/mysql/mysql-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/mysql/mysql-user.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
SET LOGGED_IN = FALSE
146146
</update>
147147

148-
<select id='selectPreferencesForUser' parameterType='java.lang.String' resultType='KeyValuePair'>
148+
<select id='selectPreferencesForUser' parameterType='java.lang.Integer' resultType='KeyValuePair'>
149149
SELECT NAME AS "key", VALUE AS "value"
150150
FROM PERSON_PREFERENCE
151151
WHERE PERSON_ID = #{value}

‎server/dbconf/oracle/oracle-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/oracle/oracle-user.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
SET LOGGED_IN = 0
147147
</update>
148148

149-
<select id='selectPreferencesForUser' parameterType='java.lang.String' resultType='KeyValuePair'>
149+
<select id='selectPreferencesForUser' parameterType='java.lang.Integer' resultType='KeyValuePair'>
150150
SELECT NAME "key", VALUE "value"
151151
FROM PERSON_PREFERENCE
152152
WHERE PERSON_ID = #{value}

0 commit comments

Comments
 (0)