vidakovic commented on code in PR #5436:
URL: https://github.com/apache/fineract/pull/5436#discussion_r2763459586
##########
fineract-command/src/main/java/org/apache/fineract/command/persistence/converter/JsonNodeWritingConverter.java:
##########
@@ -20,37 +20,22 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import jakarta.persistence.AttributeConverter;
-import jakarta.persistence.Converter;
-import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.convert.converter.Converter;
+import org.springframework.data.convert.WritingConverter;
+import org.springframework.stereotype.Component;
-@Slf4j
-@RequiredArgsConstructor
-@Converter
-public class JsonAttributeConverter implements AttributeConverter<JsonNode,
String> {
- // TODO: it would be nicer to use a native JSON type on the database side,
but not every system supports this;
- // string/text are the lowest common denominator that should work on every
database
+@Component
+@WritingConverter
+public class JsonNodeWritingConverter implements Converter<JsonNode, String> {
- private final ObjectMapper mapper;
+ private final ObjectMapper mapper = new ObjectMapper();
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]