0 Replies Latest reply on Jun 26, 2006 2:36 AM by japplicoon

    Clear bidirectional @OneToMany collection

    japplicoon

      Beginner's question:

      I have in an entity "FThread":

      @OneToMany(cascade=CascadeType.ALL, mappedBy="fthread")
      public List<Post> getPosts() {
       if(posts == null) posts = new ArrayList<Post>();
       return posts;
      }


      My sfsb "ThreadManager" has an extended persistence context and I verified that my fthread is currently managed when I call

      fthread.getPosts().clear();


      What is missing that the posts are not removed from the database?

      Thank you!
      sonja