3 Replies Latest reply on Jul 22, 2002 5:33 PM by isakson

    XDoclet + @jboss:relation-table

    poco

      Hi,
      I've just started using CMP 2.0 beans, and everything works fine, except for relations where I need a "link" table. How can I generate the <relation-table> tag in the jbosscmp-jdbc.xml with XDoclet? I've search a couple of places (including Xdoclet doc) but found nothing, except a marvelous post on JGuru that was saying.. "Check the XDoclet Documentation".. well.. I've checked the very last version, and this tag don't even seems to exist.

      Anyone can give me a demonstration of what I need to write (tag description + parameters) to force XDoclet to put the <relation-table> information?

      You can do a simple Example with [Table A] --> [Table AB] <-- [Table B] I would be very grateful if you could spend some time to help me out on this.... thanks!

        • 1. Re: XDoclet + @jboss:relation-table
          poco

          did I say something wrong?? something dumb??????

          please help me!!!


          • 2. Re: XDoclet + @jboss:relation-table
            dsundstrom

            I don't personally use XDoclet, but may other do. Michael is working on adding some new JBossCMP tags and documentation, but that is all I realy know. If you don't get a good response here, I suggest you post to the jboss-users list.

            • 3. Re: XDoclet + @jboss:relation-table
              isakson

              I had a similar problem and went digging in the XDoclet source. There is a template in xdoclet\ejb called jbosscmp-jdbc_xml.j that specifies what XDoclet does for the undocumented @jboss:relation-table tag. I wasn't sure if it was necessary on both sides, so I just took the hack and slash approach and put it on both. I put code like the following on both sides of my many to many relationship:

              /**
              * @return Returns the production staffers (TPSs) assigned to this content development project.
              *
              * @ejb:interface-method view-type="local"
              *
              * @ejb:relation name="content-development-project-tps"
              * role-name="one-content-development-project-has-many-tpss"
              * cascade-delete="no"
              * @jboss:relation
              * fk-column="TPS_Id_FK"
              * related-pk-field="id"
              *
              * @jboss:relation-table table-name="ContentDevelopmentProjectTPSLink"
              * create-table="true"
              * remove-table="true"
              */
              public abstract Collection getTPSs();