From af0e0a110e7187bf008655f7510199a0c0b25ec4 Mon Sep 17 00:00:00 2001 From: Nymph2333 <498092988@qq.com> Date: 星期一, 10 四月 2023 14:27:40 +0800 Subject: [PATCH] newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance() This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException. The call clazz.newInstance() can be replaced by clazz.getDeclaredConstructor().newInstance() The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException. --- ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index 2425ae0..faefb2f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -77,7 +77,7 @@ <set> <if test="postCode != null and postCode != ''">post_code = #{postCode},</if> <if test="postName != null and postName != ''">post_name = #{postName},</if> - <if test="postSort != null and postSort != ''">post_sort = #{postSort},</if> + <if test="postSort != null">post_sort = #{postSort},</if> <if test="status != null and status != ''">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> @@ -91,7 +91,7 @@ <if test="postId != null and postId != 0">post_id,</if> <if test="postCode != null and postCode != ''">post_code,</if> <if test="postName != null and postName != ''">post_name,</if> - <if test="postSort != null and postSort != ''">post_sort,</if> + <if test="postSort != null">post_sort,</if> <if test="status != null and status != ''">status,</if> <if test="remark != null and remark != ''">remark,</if> <if test="createBy != null and createBy != ''">create_by,</if> @@ -100,7 +100,7 @@ <if test="postId != null and postId != 0">#{postId},</if> <if test="postCode != null and postCode != ''">#{postCode},</if> <if test="postName != null and postName != ''">#{postName},</if> - <if test="postSort != null and postSort != ''">#{postSort},</if> + <if test="postSort != null">#{postSort},</if> <if test="status != null and status != ''">#{status},</if> <if test="remark != null and remark != ''">#{remark},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> -- Gitblit v1.9.2