Message转Dml对null值的判断

This commit is contained in:
mcy
2019-05-14 17:35:34 +08:00
parent 331dd63c5f
commit b870e7ecd0

View File

@@ -80,7 +80,8 @@ public class MessageUtil {
row.put(column.getName(), null);
} else {
row.put(column.getName(),
JdbcTypeUtil.typeConvert(dml.getTable(), column.getName(),
JdbcTypeUtil.typeConvert(dml.getTable(),
column.getName(),
column.getValue(),
column.getSqlType(),
column.getMysqlType()));
@@ -99,7 +100,8 @@ public class MessageUtil {
for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
if (updateSet.contains(column.getName())) {
rowOld.put(column.getName(),
JdbcTypeUtil.typeConvert(dml.getTable(), column.getName(),
JdbcTypeUtil.typeConvert(dml.getTable(),
column.getName(),
column.getValue(),
column.getSqlType(),
column.getMysqlType()));
@@ -166,8 +168,8 @@ public class MessageUtil {
return dml;
}
private static List<Map<String, Object>> changeRows(String table, List<Map<String, String>> rows, Map<String, Integer> sqlTypes,
Map<String, String> mysqlTypes) {
private static List<Map<String, Object>> changeRows(String table, List<Map<String, String>> rows,
Map<String, Integer> sqlTypes, Map<String, String> mysqlTypes) {
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, String> row : rows) {
Map<String, Object> resultRow = new LinkedHashMap<>();