Hallo Dave,
thanks for your answer. I made sure that I have the latest version by doing
a fresh checkout.
Unfortunately, it still does not work. No errors and no relationship are
generated.
What do you mean by target-ejb? Is this a parameter of the relationship tag?
(if yes, it is not documented)
Maybe my understanding of 1:n relationships is not enough (please correct
me):
Let me state an example: 1 Account has Many Positions
Usually Position will have a field with an account id, also called foreign
key.
Is this foreign key field to be declared as a @ejb:persistent-field?
How does the @ejb:relationship tag look for this foreign key field?
On the other side, the Account, there is a method getPositions() that allows
to get all Positions in a Collection.
Of course, this getPositions() method is no @ejb:persistent-field.
The relationship-tag for getPositions() looks like this:
@ejb:relationship home="PositionHome" method="findByAccount"
params="getId()".
In Position, I added the referenced finder (at class level):
@ejb:finder result-type="Collection" signature="Collection findByAccount()"
query="SELECT DISTINCT OBJECT(p) FROM Position p WHERE p.account = ?1"
Correct?
The problem is that I get no errors... if I would I could track them down.
- Andreas
----- Original Message -----
From: "Dave Smith" <[EMAIL PROTECTED]>
To: "Andreas Schildbach" <[EMAIL PROTECTED]>
Sent: Saturday, September 08, 2001 20:55
Subject: Re: [Xdoclet-devel] xdoclet and relationships
> They do in the current cvs. You have to declare the relationship at the
> method level. If it is a bidirectional then us the ejb:relation tag on
> both methods that define the relationship. If it is uni-directional you
> have to define target-ejb.
>
>
> Andreas Schildbach wrote:
>
> > Do relationships actually work?
> >
> > I tried adding a @ejb:relationship tag, but it seems as if its
completely
> > ignored.
> >
> > - no errors appear
> > - in the ejb-jar.xml, the <relationships> section is left completely
empty
> > - as a consequence, no CMR fields are declared in ejb-jar.xml (btw.
don't I
> > have to declare them somehow in my bean source?)
> > - how do I declare if a relationship is bidirectional or unidirectional?
> >
> > Greetings,
> >
> > Andreas
> > ____________________________________
> > Andreas Schildbach
> > senior software architect and developer
> > financial media service
> >
> >
> >
> > _______________________________________________
> > Xdoclet-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
> >
>
>
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel