I too needed this for JBoss 2.5, and implemented it last weekend. It works
as you describe, but needs polish (like cascade-delete). I only did a
trivial <query> for jbosscmp-jdbc.xml that takes either <declared-sql> or
<ejb-ql>. I can supply sources or commit; could you or Ara say how you'd
like the contribution.
I actually got skittish about the tags being in flux, since I'd already
rewritten some ejbdoclet tags, so I wrote a different XDoclet concept. This
uses Jasper (Tomcat's jsp) for the template engine. The templates look like
ordinary jsps, with some additional hooks for e.g. setting the output file.
I call it JTP for java taglets. The JTPRunner does what you'd expect, and
writing the .jtp files has all the pros and cons of writing .jsps. (Of
course the server apis are stubs, but you set page attributes in the usual
way. The RootDoc is exposed to the jtp that way.)
I do like that template generation is not built into the tool as subtasks;
you just pass Taglet a list of jtp files, though it's easy to write a
subclass of Taglet that knows about special templates. This feature makes an
XDoclet that is more easily extensible. I also like that taglibs formalize
the relation between tags and handler classes.
I'm just typing in the jtps for ejb support; naturally it's very similar to
current xdoclet. If there's interest, that can go in, too; it resides in
xdoclet.taglet atm.
Andrew
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Dave
> Smith
> Sent: Monday, August 27, 2001 10:14 AM
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-devel] EJB 2.0 relations
>
>
> Well after toiling throught the spec I think the best way to add the
> relations code is to add the tags at the method level.
> Something like
>
> OrderEJB
>
> /**
> @ejb:relation name="Order-LineItem" multiplicity="One"
> */
> public abstract Collection getLineItems();
>
> and in LineItemEJB
>
> /**
> @ejb:relation name="Order-LineItem" multiplicity="Many"
> cascade-delete="true"
> */
> public abstract int getOrderId();
>
>
> to generate
>
> <ejb-relation>
> <ejb-relation-name>Order-LineItem</ejb-relation-name>
> <ejb-relationship-role>
> <multiplicity>One</multiplicity>
> <relactionship-role-source>
> <ejb-name>OrderEJB</ejb-name>
> </relactionship-role-source>
> <cmr-field>
> <cmr-field-name>lineItems</cmr-field-name>
> <cmr-field-type>java.util.Collection</cmr-field-type>
> </cmr-field>
> </ejb-relationship-role>
>
> <ejb-relationship-role>
> <multiplicity>Many</multiplicity>
> <cascade-delete/>
> <relationship-role-source>
> <ejb-name>LineItemEJB</eib-name>
> <relationship-role-source>
> <cmr-field>
> <cmr-field-name>orderId</cmr-field-name>
> </cmr-field>
> </relationship-role-source>
> </ejb-relation>
>
>
> Now there are two problems
> 1) I need to be able to keep a list of relation tags so I can look up
> the other side of the relation and then I need to remove both of them
> from the list when I am done. Otherwise each entry will be in there twice
>
> 2) I need to add the option unidirect-ejbname so if it is a
> unidircetional relationship I don't go looking for the matching class.
>
>
> I am still tracking down all of the jboss tags but the key ones will be
>
> eager and lazy loading as well as table name definition for many to many
> and uni-directional 1 to many relations.
>
>
> So ...
>
> Comments? If I go ahead with this I need some direction on how to add
> the relation list and any other relative bits ....
>
>
>
>
>
> _______________________________________________
> Xdoclet-devel mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/xdoclet-devel
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/xdoclet-devel