I'm using mapstruct to do the mapping between two calsses : Candidate and CandidateDTO .
My mapper interface is like that:
@Mapper
public interface CandidateMapper {
CandidateDTO toCandidateDTO(Optional<CandidateEntity> candidateEntity);
}
And the generated source is like that :
public class CandidateMapperImpl implements CandidateMapper {
@Override
public CandidateDTO toCandidateDTO(Optional<CandidateEntity> candidateEntity) {
if ( candidateEntity == null ) {
return null;
}
CandidateDTO candidateDTO = new CandidateDTO();
return candidateDTO;
}
}
My problem here is that when mapping i get all DTO fields null because the mapping field is not generated.
Any help please.