From 45eddc578da1fcc37fc45481890d42499e1f5047 Mon Sep 17 00:00:00 2001 From: Gerben Kroes Date: Mon, 16 Oct 2023 10:46:20 +0200 Subject: [PATCH 1/2] Log mapping issue domain adapter pq data Signed-off-by: Gerben Kroes --- .../customconverters/ProfileEntryValueConverter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java index 10433d05fa1..ed2bccd6940 100644 --- a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java @@ -6,12 +6,14 @@ import java.math.BigDecimal; import java.util.Date; +import lombok.extern.slf4j.Slf4j; import ma.glasnost.orika.CustomConverter; import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.metadata.Type; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ProfileEntryValue; import org.opensmartgridplatform.dto.valueobjects.smartmetering.ProfileEntryValueDto; +@Slf4j public class ProfileEntryValueConverter extends CustomConverter { @@ -32,8 +34,11 @@ public ProfileEntryValue convert( return new ProfileEntryValue(integer); } else if (value instanceof final Short shortValue) { return new ProfileEntryValue(shortValue); + } else if (value instanceof final String stringValue) { + return new ProfileEntryValue(stringValue); } else { - return new ProfileEntryValue((String) value); + log.info("Using default convert toString() for value {}", value); + return new ProfileEntryValue(value.toString()); } } else { return new ProfileEntryValue((String) null); From 3889bbcf8e6f6c36eb894f9f5b9c188fc27b0eb0 Mon Sep 17 00:00:00 2001 From: Gerben Kroes Date: Mon, 16 Oct 2023 10:56:17 +0200 Subject: [PATCH 2/2] Also log class name Signed-off-by: Gerben Kroes --- .../mapping/customconverters/ProfileEntryValueConverter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java index ed2bccd6940..0009cc2a8d5 100644 --- a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/mapping/customconverters/ProfileEntryValueConverter.java @@ -37,7 +37,10 @@ public ProfileEntryValue convert( } else if (value instanceof final String stringValue) { return new ProfileEntryValue(stringValue); } else { - log.info("Using default convert toString() for value {}", value); + log.info( + "Using default convert toString() for value {}, with class {}", + value, + value.getClass().getSimpleName()); return new ProfileEntryValue(value.toString()); } } else {