0 Replies Latest reply on Jun 26, 2006 2:36 AM by sonja löhr

    Clear bidirectional @OneToMany collection

    sonja löhr Newbie

      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