Foreign Key Constraints and Persistence Issues in Seam


2008-04-30 Digg! icurtain Delcious icurtain Technorati icurtain


public String persist() { //this forces the persist function to persist IbUser before Rcs User and avoids the FKC issue getEntityManager().persist(getInstance().getIbUser()); return super.persist(); }

finding values through hibernate

@Override public String persist(){ //check if the nlc is duplicated here if(getEntityManager().find(JourneyLocation.class, this.instance.getNlc())!=null){ getFacesMessages().add(FacesMessage.SEVERITY_ERROR, "#{messages.nlcExists}") ; return null; }else{ return super.persist(); } }