public static Map<String, Object> clobToStringByMap(Map<String, Object> map) {
if (map == null) {
return map;
}
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object t1 = entry.getValue();
if (t1 instanceof Clob) {// 将所有Clob类型的字段都转换为String类型
entry.setValue(clobToString((Clob) t1));
}
}
return map;
}
public static String clobToString(Clob clob) {
String result = "";
try {
if (clob instanceof Clob) {
result = (clob != null ? clob.getSubString(1, (int) clob.length()) : null);
}
} catch (Exception e) {
// TODO: handle exception
}
return result;
}