This commit is contained in:
Looly 2024-07-13 18:46:26 +08:00
parent b9c7b5f4bf
commit 7b10238225
3 changed files with 30 additions and 2 deletions

View File

@ -120,11 +120,13 @@ public class CharSequenceUtil extends StrValidator {
} }
/** /**
* 调用对象的toString方法{@code null}会返回空字符串 "" * 调用对象的toString方法{@code null}会返回空字符串 ""<br>
* 如果仅仅是对{@link CharSequence}处理请使用{@link #emptyIfNull(CharSequence)}
* *
* @param obj 对象 * @param obj 对象
* @return {@link String } * @return {@link String }
* @author Junwei Xu * @author Junwei Xu
* @see #emptyIfNull(CharSequence)
*/ */
public static String toStringOrEmpty(final Object obj) { public static String toStringOrEmpty(final Object obj) {
// obj为空时, 返回 null "null" 都不适用部分场景, 此处返回 "" 空字符串 // obj为空时, 返回 null "null" 都不适用部分场景, 此处返回 "" 空字符串

View File

@ -38,7 +38,7 @@
<druid.version>1.2.21</druid.version> <druid.version>1.2.21</druid.version>
<!-- 固定4.x --> <!-- 固定4.x -->
<hikariCP.version>4.0.3</hikariCP.version> <hikariCP.version>4.0.3</hikariCP.version>
<sqlite.version>3.45.1.0</sqlite.version> <sqlite.version>3.46.0.0</sqlite.version>
<!-- 此处固定2.5.x支持到JDK8 --> <!-- 此处固定2.5.x支持到JDK8 -->
<hsqldb.version>2.5.2</hsqldb.version> <hsqldb.version>2.5.2</hsqldb.version>
</properties> </properties>

View File

@ -0,0 +1,26 @@
/*
* Copyright (c) 2024. looly(loolly@aliyun.com)
* Hutool is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* https://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package org.dromara.hutool.db;
import org.dromara.hutool.db.config.DbConfig;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
public class Issue3654Test {
@Test
@Disabled
void insertSqliteTest() {
final Db db = Db.of(DbConfig.of().setUrl("jdbc:sqlite:d:/test/test.db"));
db.insert(Entity.of("user").set("age", "testStr2"));
}
}