8 Replies Latest reply on Jun 8, 2008 3:45 PM by Ohad Assulin

    delete from non-owner relationship

    Ohad Assulin Newbie

      I've a Candidate and a CandidateTest entities
      for each Candidate I've many CandidateTests.

      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "candidate")
           public Set<CandidateTest> getCandidateTests() {
                return this.candidateTests;


      I've a CandidateHome SFSS with Conversation scope (manual flushmode)

      I've a candidatePage.xhtml as well
      from this page I'm calling a del(CandidateTest ct) method using a4j:commandButton

      this method remove the CandidateTest from the collection: candidate.getCandidateTests().remove(ct);
      (I implemented the equals method and it actualy removing it)

      after that in the screen I've a h:commandButton that calls the action candidateHome.update()

      for unkown reason it won't delete the CandidateTest from the DB...

      any ideas?

      Thanks a lot!!!

      I tried to added Hibernate Extention to Cascade(delete orphem) but then I'm getting
      deleted entity passed to persist Exception..