6 Replies Latest reply on Nov 22, 2003 6:23 AM by musophil

    many to many CMR

    index

      Hi,
      I checked sources for exercise 7. I'm trying to understand the way Jboss handles many to many relationships. Questions are - Do I need to create link table? Do I need to map the link table in descriptors - how? Does jboss handle that (create table) automatically?

      Thanks, Milan

        • 1. Re: many to many CMR
          index

          hi, is there anyone?
          I just wonder how these examples work at all - there are no relationships declarations in jbosscmp-jdbc.xml
          Aren't these declaration supposed to be there?
          Milan

          • 2. Re: many to many CMR
            zeroshot

            i was impressed on how jboss did this i declared a many-many relationship in the ejb-jar.xml and jboss created the link table on its own with the necessary stuff needed

            • 3. Re: many to many CMR
              slaboure

              Hello,

              By default, JBoss can take decision by itself if you don't specify anything. Consequently, most CMP2 applications do not require a jboss specific deployment descriptor at all (at least during prototyping, when you don't care about table names, etc.)

              Cheers,


              sacha

              • 4. Re: many to many CMR

                Okay, so I finally found out that jboss will generate the linking table on it's own for a many to many relationship. But is it possible to map a pre-existing linking table for the link between two tables in a many to many relationship? I can't find any examples of how to do this in the orielly book, or in the jboss-specific workbook. I just want to use a pre-existing link table that I already have.

                • 5. Re: many to many CMR
                  slaboure

                  Yes, this is described in the JBossCMP specific book in details.

                  Cheers,


                  sacha

                  • 6. Re: many to many CMR
                    musophil

                    I believe the J2EE Patterns book available at www.theserverside.com provides a good clear explination of different approaches to achieving CMR with or without control control by the container.

                    Its a good book, although lacks XDoclet.