Generate question bank domain model from JDL
This commit is contained in:
1 parent
1d97cc4e31
commit
1d74d8f04b
160 files changed
+26900
-2
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.example.questionbank.service.mapper;
|
||||
|
||||
import com.example.questionbank.domain.ExamAnswer;
|
||||
import com.example.questionbank.domain.ExamAttempt;
|
||||
import com.example.questionbank.domain.Question;
|
||||
import com.example.questionbank.service.dto.ExamAnswerDTO;
|
||||
import com.example.questionbank.service.dto.ExamAttemptDTO;
|
||||
import com.example.questionbank.service.dto.QuestionDTO;
|
||||
import org.mapstruct.*;
|
||||
|
||||
/**
|
||||
* Mapper for the entity {@link ExamAnswer} and its DTO {@link ExamAnswerDTO}.
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ExamAnswerMapper extends EntityMapper<ExamAnswerDTO, ExamAnswer> {
|
||||
@Mapping(target = "question", source = "question", qualifiedByName = "questionId")
|
||||
@Mapping(target = "attempt", source = "attempt", qualifiedByName = "examAttemptId")
|
||||
ExamAnswerDTO toDto(ExamAnswer s);
|
||||
|
||||
@Named("questionId")
|
||||
@BeanMapping(ignoreByDefault = true)
|
||||
@Mapping(target = "id", source = "id")
|
||||
QuestionDTO toDtoQuestionId(Question question);
|
||||
|
||||
@Named("examAttemptId")
|
||||
@BeanMapping(ignoreByDefault = true)
|
||||
@Mapping(target = "id", source = "id")
|
||||
ExamAttemptDTO toDtoExamAttemptId(ExamAttempt examAttempt);
|
||||
}
|
||||
Reference in new issue
Block a user