I have following SQL query
SELECT
customer.CUSTOMER_NUMBER customerNumber,
contractDetail.START_DATE campaignStartDate,
contractDetail.END_DATE campaignEndDate,
contractDetailCommitment.END_DATE commitmentEndDate,
contractDetail.CONTRACT_DETAIL_STATUS statusCode,
baseOffer.NAME campaignName,
property.CODE propertyCode,
DECODE(property.TYPE, 'LOV', propertyListChoice.CODE, assetPropertyValue.PROPERTY_VALUE) propertyValue
FROM .............
The query structure is not important, it returns data like this
So, different values only in two fields: propertyCode and propertyValue. I want to map the result of this query to following dto object:
@Data
public class ContractInfoDTO {
private String customerNumber;
private String campaignStartDate;
private String campaignEndDate;
private String campaignName;
private String statusCode;
private List<Property> properties;
}
Is it possible to do that automatically? Or the only solution is to write custom ResultTransformer
and handle all three rows one by one?