Another odd thing with hibernate: using the code below I'm unable to update entity data but successfully may add new one to collection :
/** | * Writes qualification info into DB | * | * @param qualification object model to be updated | * @return true if successfull | * @throws Exception | */ | public boolean saveQualification(UsersAcademicQualifications qualification) throws Exception { | if (qualification != null) { | | usersAcademicQualificationsHome.setInstance(qualification); | | if (qualification.getId() != null && qualification.getId().trim().length() > 0) { | usersAcademicQualificationsHome.update(); | } | else { | usersAcademicQualificationsHome.persist(); | } | | usersAcademicQualificationsHome.getEntityManager().flush(); | | //updating related entities | usersAcademicQualificationsHome.setId(qualification.getId()); | qualification = usersAcademicQualificationsHome.find(); | | //adding new qualification to related Users object | { | qualification.getUsers().getUsersAcademicQualifications().add(qualification); | usersFacade.saveUser(qualification.getUsers()); | } | | return true; | } | return false; | } View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113214#4113214 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113214 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user