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,22 @@
|
||||
package com.example.questionbank.service.mapper;
|
||||
|
||||
import com.example.questionbank.domain.Question;
|
||||
import com.example.questionbank.domain.Subject;
|
||||
import com.example.questionbank.service.dto.QuestionDTO;
|
||||
import com.example.questionbank.service.dto.SubjectDTO;
|
||||
import org.mapstruct.*;
|
||||
|
||||
/**
|
||||
* Mapper for the entity {@link Question} and its DTO {@link QuestionDTO}.
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface QuestionMapper extends EntityMapper<QuestionDTO, Question> {
|
||||
@Mapping(target = "subject", source = "subject", qualifiedByName = "subjectName")
|
||||
QuestionDTO toDto(Question s);
|
||||
|
||||
@Named("subjectName")
|
||||
@BeanMapping(ignoreByDefault = true)
|
||||
@Mapping(target = "id", source = "id")
|
||||
@Mapping(target = "name", source = "name")
|
||||
SubjectDTO toDtoSubjectName(Subject subject);
|
||||
}
|
||||
Reference in new issue
Block a user