generated from mingliqiye/lib-tem
Merge pull request 'refactor(mybatis): 更新类型处理器以支持 JDBC 类型参数为 null' (#7) from dev into master
All checks were successful
Gitea Actions Build / Build (push) Successful in 2m25s
All checks were successful
Gitea Actions Build / Build (push) Successful in 2m25s
Reviewed-on: #7
This commit is contained in:
commit
0b1aac8ecc
@ -16,10 +16,10 @@
|
|||||||
# ProjectName mingli-utils
|
# ProjectName mingli-utils
|
||||||
# ModuleName mingli-utils
|
# ModuleName mingli-utils
|
||||||
# CurrentFile gradle.properties
|
# CurrentFile gradle.properties
|
||||||
# LastUpdate 2025-09-15 12:45:46
|
# LastUpdate 2025-09-15 13:54:50
|
||||||
# UpdateUser MingLiPro
|
# UpdateUser MingLiPro
|
||||||
#
|
#
|
||||||
JDKVERSIONS=1.8
|
JDKVERSIONS=1.8
|
||||||
GROUPSID=com.mingliqiye.utils
|
GROUPSID=com.mingliqiye.utils
|
||||||
ARTIFACTID=mingli-utils
|
ARTIFACTID=mingli-utils
|
||||||
VERSIONS=4.0.3
|
VERSIONS=4.0.4
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
* ProjectName mingli-utils
|
* ProjectName mingli-utils
|
||||||
* ModuleName mingli-utils.main
|
* ModuleName mingli-utils.main
|
||||||
* CurrentFile DateTimeTypeHandler.kt
|
* CurrentFile DateTimeTypeHandler.kt
|
||||||
* LastUpdate 2025-09-14 18:19:29
|
* LastUpdate 2025-09-15 13:53:53
|
||||||
* UpdateUser MingLiPro
|
* UpdateUser MingLiPro
|
||||||
*/
|
*/
|
||||||
@file:JvmName("DateTimeConvertor")
|
@file:JvmName("DateTimeConvertor")
|
||||||
@ -65,8 +65,8 @@ class DateTimeTypeHandler : BaseTypeHandler<DateTime>() {
|
|||||||
override fun setNonNullParameter(
|
override fun setNonNullParameter(
|
||||||
ps: PreparedStatement,
|
ps: PreparedStatement,
|
||||||
i: Int,
|
i: Int,
|
||||||
parameter: DateTime, // 移除了 ?,因为这是 non-null 方法
|
parameter: DateTime,
|
||||||
jdbcType: JdbcType
|
jdbcType: JdbcType?
|
||||||
) {
|
) {
|
||||||
// 使用 setObject 允许传入 null,由数据库处理
|
// 使用 setObject 允许传入 null,由数据库处理
|
||||||
ps.setObject(i, toLocalDateTime(parameter))
|
ps.setObject(i, toLocalDateTime(parameter))
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
* ProjectName mingli-utils
|
* ProjectName mingli-utils
|
||||||
* ModuleName mingli-utils.main
|
* ModuleName mingli-utils.main
|
||||||
* CurrentFile UUIDTypeHandler.kt
|
* CurrentFile UUIDTypeHandler.kt
|
||||||
* LastUpdate 2025-09-14 18:19:29
|
* LastUpdate 2025-09-15 13:54:18
|
||||||
* UpdateUser MingLiPro
|
* UpdateUser MingLiPro
|
||||||
*/
|
*/
|
||||||
@file:JvmName("UUIDConvertor")
|
@file:JvmName("UUIDConvertor")
|
||||||
@ -112,7 +112,7 @@ class UUIDBinaryTypeHandler : BaseTypeHandler<UUID>() {
|
|||||||
* @param jdbcType JDBC类型
|
* @param jdbcType JDBC类型
|
||||||
*/
|
*/
|
||||||
override fun setNonNullParameter(
|
override fun setNonNullParameter(
|
||||||
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType
|
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType?
|
||||||
) {
|
) {
|
||||||
ps.setBytes(i, uuidToByteArray(parameter))
|
ps.setBytes(i, uuidToByteArray(parameter))
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ class UUIDStringTypeHandler : BaseTypeHandler<UUID>() {
|
|||||||
* @param jdbcType JDBC类型
|
* @param jdbcType JDBC类型
|
||||||
*/
|
*/
|
||||||
override fun setNonNullParameter(
|
override fun setNonNullParameter(
|
||||||
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType
|
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType?
|
||||||
) {
|
) {
|
||||||
ps.setString(i, uuidToString(parameter))
|
ps.setString(i, uuidToString(parameter))
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ class UUIDTypeHandler : BaseTypeHandler<UUID>() {
|
|||||||
* @param jdbcType JDBC类型
|
* @param jdbcType JDBC类型
|
||||||
*/
|
*/
|
||||||
override fun setNonNullParameter(
|
override fun setNonNullParameter(
|
||||||
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType
|
ps: PreparedStatement, i: Int, parameter: UUID, jdbcType: JdbcType?
|
||||||
) {
|
) {
|
||||||
ps.setObject(i, parameter.getUuid())
|
ps.setObject(i, parameter.getUuid())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
* ProjectName mingli-utils
|
* ProjectName mingli-utils
|
||||||
* ModuleName mingli-utils.main
|
* ModuleName mingli-utils.main
|
||||||
* CurrentFile MysqlUUIDBinaryTypeHandler.kt
|
* CurrentFile MysqlUUIDBinaryTypeHandler.kt
|
||||||
* LastUpdate 2025-09-14 18:19:29
|
* LastUpdate 2025-09-15 13:54:29
|
||||||
* UpdateUser MingLiPro
|
* UpdateUser MingLiPro
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class MysqlUUIDBinaryTypeHandler : BaseTypeHandler<UUID>() {
|
|||||||
ps: PreparedStatement,
|
ps: PreparedStatement,
|
||||||
i: Int,
|
i: Int,
|
||||||
parameter: UUID,
|
parameter: UUID,
|
||||||
jdbcType: JdbcType
|
jdbcType: JdbcType?
|
||||||
) {
|
) {
|
||||||
ps.setBytes(i, toByteArray(parameter))
|
ps.setBytes(i, toByteArray(parameter))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user