diff --git a/mapstruct/src/main/java/com/baeldung/mapper/EmployeeMapper.java b/mapstruct/src/main/java/com/baeldung/mapper/EmployeeMapper.java index 8e00103d0e..716b05c7d9 100644 --- a/mapstruct/src/main/java/com/baeldung/mapper/EmployeeMapper.java +++ b/mapstruct/src/main/java/com/baeldung/mapper/EmployeeMapper.java @@ -6,17 +6,20 @@ import com.baeldung.entity.Division; import com.baeldung.entity.Employee; import org.mapstruct.Mapper; import org.mapstruct.Mapping; -import org.mapstruct.Mappings; import java.util.List; @Mapper public interface EmployeeMapper { - @Mappings({ @Mapping(target = "employeeId", source = "entity.id"), @Mapping(target = "employeeName", source = "entity.name"), @Mapping(target = "employeeStartDt", source = "entity.startDt", dateFormat = "dd-MM-yyyy HH:mm:ss") }) + @Mapping(target = "employeeId", source = "entity.id") + @Mapping(target = "employeeName", source = "entity.name") + @Mapping(target = "employeeStartDt", source = "entity.startDt", dateFormat = "dd-MM-yyyy HH:mm:ss") EmployeeDTO employeeToEmployeeDTO(Employee entity); - @Mappings({ @Mapping(target = "id", source = "dto.employeeId"), @Mapping(target = "name", source = "dto.employeeName"), @Mapping(target = "startDt", source = "dto.employeeStartDt", dateFormat = "dd-MM-yyyy HH:mm:ss") }) + @Mapping(target = "id", source = "dto.employeeId") + @Mapping(target = "name", source = "dto.employeeName") + @Mapping(target = "startDt", source = "dto.employeeStartDt", dateFormat = "dd-MM-yyyy HH:mm:ss") Employee employeeDTOtoEmployee(EmployeeDTO dto); DivisionDTO divisionToDivisionDTO(Division entity);