Change package to com.baeldung
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.baeldung.mapper;
|
||||
|
||||
import com.baeldung.dto.DivisionDTO;
|
||||
import com.baeldung.dto.EmployeeDTO;
|
||||
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") })
|
||||
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") })
|
||||
Employee employeeDTOtoEmployee(EmployeeDTO dto);
|
||||
|
||||
DivisionDTO divisionToDivisionDTO(Division entity);
|
||||
|
||||
Division divisionDTOtoDivision(DivisionDTO dto);
|
||||
|
||||
List<Employee> convertEmployeeDTOListToEmployeeList(List<EmployeeDTO> list);
|
||||
|
||||
List<EmployeeDTO> convertEmployeeListToEmployeeDTOList(List<Employee> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.mapper;
|
||||
|
||||
import com.baeldung.dto.SimpleSource;
|
||||
import com.baeldung.entity.SimpleDestination;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SimpleSourceDestinationMapper {
|
||||
|
||||
SimpleDestination sourceToDestination(SimpleSource source);
|
||||
|
||||
SimpleSource destinationToSource(SimpleDestination destination);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user