FIX XML
ADD MAPPING
This commit is contained in:
@@ -2,11 +2,25 @@ package fr.istic.taa.jaxrs.Mapper;
|
||||
|
||||
import fr.istic.taa.jaxrs.DTO.QuestionDTO;
|
||||
import fr.istic.taa.jaxrs.metier.Question;
|
||||
import fr.istic.taa.jaxrs.metier.Reponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface QuestionMapper {
|
||||
QuestionMapper INSTANCE = Mappers.getMapper( QuestionMapper.class );
|
||||
|
||||
|
||||
@Mapping(target = "reponses_string", expression = "java(question_ReponseString(question.getReponse()))")
|
||||
QuestionDTO toDTO(Question question);
|
||||
|
||||
Question toEntity(QuestionDTO questionDTO);
|
||||
|
||||
default List<String> question_ReponseString(Reponse reponse){
|
||||
return reponse.getReponses();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user