@Mapping(from = ServerCpu.class, to = Cpu.class) public static Cpu map(ServerCpu entity, Cpu template) { Cpu model = template != null ? template : new Cpu(); model.setName(entity.getCpuName()); model.setLevel(entity.getLevel()); model.setArchitecture(map(entity.getArchitecture(), null)); return model; }
to.setName(from.getName());
cpu.setName(entity.getCpuModel()); if (entity.getCpuName() != null) { cpu.setType(entity.getCpuName().getCpuName());