public GetDeptFindByPKResponse getDepartment(GetDeptFindByPK parameters) {
List<Dept> result = scottEJB.getDeptFindByPK(parameters.getId());
if (result != null && result.size() > 0) {
Dept dept = result.get(0);
GetDeptFindByPKResponse response = obj.createGetDeptFindByPKResponse();
Department department = obj.createDepartment();
department.setDepartmentNr(dept.getDeptno());
department.setLocation(dept.getLoc());
department.setName(dept.getDname());
for ( Emp emp : dept.getEmpList()) {
Employee employee = obj.createEmployee();
employee.setCommission(emp.getComm());
employee.setEmployeeNr(emp.getEmpno());
employee.setHiredate(getXMLGregorianCalendar(emp.getHiredate()));
employee.setJob(emp.getJob());
employee.setManager(emp.getMgr());
employee.setName(emp.getEname());
employee.setSalary(emp.getSal());
department.getEmployees().add(employee);
}
response.setDepartment(department);
return response;
}
return null; }