private void createBedDesignationList() { List<AdmissionPart> admissionPartList = patientAdmissionSchedule.getAdmissionPartList(); List<BedDesignation> bedDesignationList = new ArrayList<BedDesignation>(admissionPartList.size()); long id = 0L; for (AdmissionPart admissionPart : admissionPartList) { BedDesignation bedDesignation = new BedDesignation(); bedDesignation.setId(id); id++; bedDesignation.setAdmissionPart(admissionPart); // Notice that we leave the PlanningVariable properties on null bedDesignationList.add(bedDesignation); } patientAdmissionSchedule.setBedDesignationList(bedDesignationList); }