@Override public void convert(ProjectWorkerDto projectWorkerDto, ProjectWorker projectWorker) { super.convert(projectWorkerDto, projectWorker); if (projectWorker.getId() == 0) { projectWorker.setId(null); projectWorker.setVersion(null); } if (projectWorker.getPermissions() == null) { projectWorker.setPermissions(new Permissions()); } projectWorker .getPermissions() .setIterationAdmin(projectWorkerDto.getPermissions().getIterationAdmin()); projectWorker .getPermissions() .setProjectAdmin(projectWorkerDto.getPermissions().getProjectAdmin()); }
@Override public ProjectWorker createDestinationObject(ProjectWorkerDto dto) { return dto.getId() == 0 ? new ProjectWorker() : projectWorkerDao.findById(dto.getId()); }