1 Reply Latest reply on Mar 16, 2003 8:48 AM by Wouter Zoons

    CMR many-2-many: howto add/remove beans ?

    Wouter Zoons Newbie


      does anyone here has any experience with many-to-many relationships managed by the container (EJB2.x) ?

      Jboss creates and manages the JOIN table for you, but I wonder what happens when you want to do destructive operations on these relations, for example:

      Suppose you have UserEJB and ProjectEJB:
      1. users work on several projects, and
      2. projects can have several users working on them

      this is many-to-many

      how would you add a user to a project in this case ? would you simply call project.getUsers(), get the Collection and add a user bean there ? will JBoss handle this correctly by updating the JOIN table ?