main
|
Last change
on this file since 700e2f9 was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago |
|
Init
|
-
Property mode
set to
100644
|
|
File size:
791 bytes
|
| Line | |
|---|
| 1 | package com.finki.icare.mapper;
|
|---|
| 2 |
|
|---|
| 3 | import com.finki.icare.dto.CommentDTO;
|
|---|
| 4 | import com.finki.icare.model.Comment;
|
|---|
| 5 | import org.mapstruct.Mapper;
|
|---|
| 6 | import org.mapstruct.Mapping;
|
|---|
| 7 | import org.mapstruct.MappingConstants;
|
|---|
| 8 |
|
|---|
| 9 | @Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
|---|
| 10 | public interface CommentMapper {
|
|---|
| 11 |
|
|---|
| 12 | @Mapping(target = "idComment", source = "idComment")
|
|---|
| 13 | @Mapping(target = "content", source = "content")
|
|---|
| 14 | @Mapping(target = "dateOfComment", source = "dateOfComment")
|
|---|
| 15 | @Mapping(target = "patientId", source = "patient.idUser")
|
|---|
| 16 | @Mapping(target = "patientUsername", source = "patient.username")
|
|---|
| 17 | @Mapping(target = "patientName", expression = "java(comment.getPatient().getName() + \" \" + comment.getPatient().getSurname())")
|
|---|
| 18 | CommentDTO toDTO(Comment comment);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.