@Mapping(target = "documentType", source = "dto.documentTypeId", qualifiedByName = "UpdateDocumentType")
void update(@MappingTarget MyEntity entity, MyDTO dto);
@Named("UpdateDocumentType")
default MyEntity updateDocumentType(MyEntity entity, MyDTO dto) {
if (dto.getDocTypeId() == null) {
entity.setDocumentType(null);
}
if (entity.getDocumentType() == null) {
entity.setDocumentType(new DocType());
entity.getDocumentType().setId(dto.getDocTypeId());
}
return entity;
}
Qualifier error. No method found annotated with @Named#value: [ UpdateDocumentTypeQualified ].
I want to update the entity but with null support on this Enum. Maybe I wrote the update method incorrectly?