Department depart = entityManager.find(Department.class, Long
.valueOf(departmentid));
user.setDepartment(depart);
}
if (positionid != null && !positionid.equals("")) {
Position pos = entityManager.find(Position.class, Long
.valueOf(positionid));
user.setPosition(pos);
user.setPositionName(pos.getName());
}
entityManager.persist(user);
}