Tidy internals ScalarTypeJsonObjectMapper, no functional change

This commit is contained in:
rbygrave
2021-06-10 19:00:35 +12:00
parent 37dff62fa9
commit 9be1dcff6c
@@ -142,7 +142,7 @@ public class ScalarTypeJsonObjectMapper {
private final ObjectMapper objectReader;
private JavaType deserType;
private final JavaType deserType;
private final String pgType;
@@ -224,12 +224,7 @@ public class ScalarTypeJsonObjectMapper {
if (value == null) {
binder.setNull(Types.VARCHAR); // use varchar, otherwise SqlServer/db2 will fail with 'Invalid JDBC data type 5.001.'
} else {
try {
String json = objectWriter.writeValueAsString(value);
binder.setString(json);
} catch (JsonProcessingException e) {
throw new SQLException("Unable to create JSON", e);
}
binder.setString(formatValue(value));
}
}
}