Skip to content
Snippets Groups Projects
Commit 197f2215 authored by Jan Tymel's avatar Jan Tymel
Browse files

Add entities-to-ID mapping in order to fix returned values in phaseRelation...

Add entities-to-ID mapping in order to fix returned values in phaseRelation when getting a questionnaire phase detail

Related to #3
parent c2d287a6
No related branches found
No related tags found
No related merge requests found
......@@ -100,5 +100,23 @@ public interface BeanMapper {
QuestionPhaseRelation toEntity(QuestionPhaseRelationDto questionnairePhaseDto);
@Mapping(target = "phaseId", source = "relatedTrainingPhase")
@Mapping(target = "questionIds", source = "questions")
QuestionPhaseRelationDto toDto(QuestionPhaseRelation questionnairePhase);
default Long mapTrainingPhaseId(TrainingPhase trainingPhase) {
if (trainingPhase == null) {
return null;
} else {
return trainingPhase.getId();
}
}
default Long mapQuestionId(Question question) {
if (question == null) {
return null;
} else {
return question.getId();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment