mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 05:19:00 +08:00
♻️ Refactoring code.解决数据库存空串的情况
This commit is contained in:
1 parent
e7e31200f2
commit
1e79c85b17
2 files changed
+6
No files matched your search
+3
@@ -36,6 +36,7 @@ public class JsonLongArrayTypeHandler extends BaseTypeHandler<Long[]> {
|
||||
@SneakyThrows
|
||||
public Long[] getNullableResult(ResultSet rs, String columnName) {
|
||||
String reString = rs.getString(columnName);
|
||||
if (StrUtil.isBlank(reString)) return new Long[]{};
|
||||
return Convert.toLongArray(reString);
|
||||
}
|
||||
|
||||
@@ -43,6 +44,7 @@ public class JsonLongArrayTypeHandler extends BaseTypeHandler<Long[]> {
|
||||
@SneakyThrows
|
||||
public Long[] getNullableResult(ResultSet rs, int columnIndex) {
|
||||
String reString = rs.getString(columnIndex);
|
||||
if (StrUtil.isBlank(reString)) return new Long[]{};
|
||||
return Convert.toLongArray(reString);
|
||||
}
|
||||
|
||||
@@ -50,6 +52,7 @@ public class JsonLongArrayTypeHandler extends BaseTypeHandler<Long[]> {
|
||||
@SneakyThrows
|
||||
public Long[] getNullableResult(CallableStatement cs, int columnIndex) {
|
||||
String reString = cs.getString(columnIndex);
|
||||
if (StrUtil.isBlank(reString)) return new Long[]{};
|
||||
return Convert.toLongArray(reString);
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -36,6 +36,7 @@ public class JsonStringArrayTypeHandler extends BaseTypeHandler<String[]> {
|
||||
@SneakyThrows
|
||||
public String[] getNullableResult(ResultSet rs, String columnName) {
|
||||
String reString = rs.getString(columnName);
|
||||
if (StrUtil.isBlank(reString)) return new String[]{};
|
||||
return Convert.toStrArray(reString);
|
||||
}
|
||||
|
||||
@@ -43,6 +44,7 @@ public class JsonStringArrayTypeHandler extends BaseTypeHandler<String[]> {
|
||||
@SneakyThrows
|
||||
public String[] getNullableResult(ResultSet rs, int columnIndex) {
|
||||
String reString = rs.getString(columnIndex);
|
||||
if (StrUtil.isBlank(reString)) return new String[]{};
|
||||
return Convert.toStrArray(reString);
|
||||
}
|
||||
|
||||
@@ -50,6 +52,7 @@ public class JsonStringArrayTypeHandler extends BaseTypeHandler<String[]> {
|
||||
@SneakyThrows
|
||||
public String[] getNullableResult(CallableStatement cs, int columnIndex) {
|
||||
String reString = cs.getString(columnIndex);
|
||||
if (StrUtil.isBlank(reString)) return new String[]{};
|
||||
return Convert.toStrArray(reString);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user