Von: [EMAIL PROTECTED] im Auftrag von Stefan Champailler
Gesendet: Mo 04.10.2004 09:34
An: [EMAIL PROTECTED]
Betreff: Re: [Xdoclet-user] value-object and "almost" self-reference
Ooops,
it seems I didn't read the documentation enough...
The solution is explained
in "Exposing Generated Methods" of the "Using Value
Objects" document. Just
had to expose the missign interface.
Since
I've serached a lot for that little info, I thought it'd be nice to have
a
small paragraph in the documentation explaining how to do
"self-reference"
with entities and XDoclet. I could write it if some of you
are ready to
proof-read it. What do you think
?
Stefan
> Dear You all,
>
>
>
I'm currently fighting big time with XDoclet to understand it. I think I
>
have a very simple problem but for some reason, I don't get it.
>
>
I have a bean that have a relationship with itself : "I'm a 'People' and
I
> can have other 'People' as friends".
>
> Out of that bean,
I try to make two value objects :
>
> - one with the bare minimum
information about a 'People' : name, role, etc.
> No information about the
"friends". It'll be called "PeopleListValue" - a
> "fat" one, with
everything from People. For the "friends" relation, I use
> an aggregate
of PeopleListValue.
>
> (I saw that idea there :
> http://www.mail-archive.com/xdoclet-user%40lists.sourceforge.net/msg03372.h
>tml)
>
>
So, I /think/ I'm OK here, no circular references. Now, for some reason
I
> completely miss, XDoclet builds an erroneous CMP class out of the bean
that
> can't compile :
>
>
foundryserver/beans/PeopleCMP.java:135: cannot resolve
symbol
> [javac] symbol : method
getPeopleListValue ()
> [javac] location:
interface
foundryserver.beans.interfaces.PeopleLocal
>
[javac]
> PeopleVOValue.addFriend(
>
((foundryserver.beans.interfaces.PeopleLocal)iFriend.next()).getPeopleListV
>alue()
);
>
> I'd be very happy if one could tell me why it tries to get
the
> PeopleListValue out of the local interface. I could think it makes
sense,
> but then, how do I tell XDoclet to generate the
getPeopleListValue ()
> method ?
>
> For information, I have
the following code in an entity bean (stripped
> useless
stuff).:
>
> ...
>
> * @ejb.value-object
name="PeopleList"
>
*
match="light"
> * @ejb.value-object name="PeopleVO"
>
*
match="fat"
> */
> public abstract class PeopleBean implements
EntityBean {
>
> ...
>
>
/**
> *
@ejb.interface-method
> * @ejb.relation
name="friendship"
>
*
role-name="ILove"
>
*
target-ejb="People"
>
*
target-role-name="ImLoved"
>
*
> *
@ejb.value-object
>
* match="fat"
>
*
type="java.util.Collection"
>
*
relation="external"
>
*
aggregate="foundryserver.beans.interfaces.PeopleListValue"
>
*
aggregate-name="Friend"
>
*
members="foundryserver.beans.interfaces.PeopleLocal"
>
*
members-name="Friend"
>
*
> * @return Returns the name. */
>
>
public abstract Collection getFriends();
>
>
> thank you for
your patience.
>
> Stefan
>
>
>
>
>
-------------------------------------------------------
> This SF.net
email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT
products in your business? Tell us what you think of them. Give us
> Your
Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
>
http://productguide.itmanagersjournal.com/guidepromo.tmpl
>
_______________________________________________
> xdoclet-user mailing
list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
-------------------------------------------------------
This
SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT
products in your business? Tell us what you think of them. Give us
Your
Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
xdoclet-user
mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user