Hi,
I am quite new to Spring and Mapstruct, I am not sure if this is the correct place to ask this, but I have the following use case I really need assistance with:

It is the typical Many-To-One use case, with added fields.
Json_object and json_attribute are both mapped by using MapStruct.
I am using @EmbeddedId on the JsonMapping entity.
If I write the JsonMappingMapper manually I can get it to work, but nowhere can I find anything about mapping Composite Keys in MapStruct.
I need to figure out how to get MapStruct to generate the following to be able to save changes on the json_mapping table:
public JsonMapping dtoToEntity(JsonObject jsonObject, JsonMappingDto dto) {
JsonMappingId id = new JsonMappingId(jsonObject.getJsonObjectId(), dto.getJsonAttribute().getJsonAttrId());
JsonMapping entity = jsonMappingRepository.findOne(id);
if (entity == null) {
entity = new JsonMapping();
}
entity.setId(new JsonMappingId(jsonObject.getJsonObjectId(), dto.getJsonAttribute().getJsonAttrId()));
entity.setJsonAttribute(jsonAttributeMapper.dtoToEntity(dto.getJsonAttribute()));
entity.setJsonObject(jsonObject);
return entity;
}
Any help would be greatly appreciated :)
Regards
Stefan du Preez