#62 Ability to use {0}-par. in ejb:relation

ejbdoclet (28)

I have a cmp bean SuperBean, which is superclass to a
number of other beans, FirstBean, SecondBean and
ThirdBean. Now, all three sub-beans are identical to
the super-bean apart from the name itself - they have
exactly the same persistent and relational fields.

The problem is that the relational field (one-to-many,
unidirectional) cannot be inherited, or more precisely
the xdoclet tags

@ejb:relation name
@jboss:target-relation fk-column

since, if I define them in SuperBean, the relations in
First-, Second- and ThirdBean will all be called the
same thing ("superbean-somebean"). This forces me to
put the relational fields in the sub-beans, so that I
can specify relation names etc. directly
("firstbean-somebean" and so on). But then I will also
have to put the ejbPostCreate() method in the
sub-beans, because I cannot call the relational field
from the ejbPostCreate() in SuperBean since there is no
such fields in it.

This leads to "copy-paste-inheritance", identical code
in several places. A solution would be to enable the
use of ejb-name parameters inside the ejb:relation tag.
Then I could name the relations "{0}-somebean" in the
superclass, and similarly for the column-names. Doing
this in XDoclet 1.1.2 generates
This would also eliminate the need for moving the
ejbPostCreate() method outside SuperBean.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks