Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log mapping issue domain adapter pq data #1097

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProfileEntryValueDto, ProfileEntryValue> {

Expand All @@ -32,8 +34,14 @@ 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 {}, with class {}",
value,
value.getClass().getSimpleName());
return new ProfileEntryValue(value.toString());
}
} else {
return new ProfileEntryValue((String) null);
Expand Down
Loading