Hi -

I have previously deployed a self-referencing relationship using the
reference  implementation (1.3b2) but the "join" table it produced looked
sick (only had 1 column - called "_PersonBean_personID")

So I assume that

1. RI not capable of self relationships
2. self relationships are not part of the CTS...

Anyone know if that is true?

~~~

The relationship was: ONE PersonBean has MANY PersonBean (children)

~~~

    <ejb-relation>
      <ejb-relation-name></ejb-relation-name>
      <ejb-relationship-role>
        <ejb-relationship-role-name>PersonBean</ejb-relationship-role-name>
        <multiplicity>one</multiplicity>
        <relationship-role-source>
          <ejb-name>PersonBean</ejb-name>
        </relationship-role-source>
        <cmr-field>
          <cmr-field-name>children</cmr-field-name>
          <cmr-field-type>java.util.Collection</cmr-field-type>
        </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
        <ejb-relationship-role-name>PersonBean</ejb-relationship-role-name>
        <multiplicity>many</multiplicity>
        <relationship-role-source>
          <ejb-name>PersonBean</ejb-name>
        </relationship-role-source>
      </ejb-relationship-role>
    </ejb-relation>

~~~

Regrds.
Peter.

----- Original Message -----
From: "Evan Ireland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 24, 2001 1:11 PM
Subject: Re: Self referencing in entity beans


> David Levine wrote:
>
> > Can an entity bean contain a Collection of references to other entity
beans
> > of the same type?
>
>
> Yes, EJB 2.0 does not forbid recursive relationships.
>
>
> > What would the deployment descriptor look like?  Especially in the
> > relationship area.
>
>
> Sorry I don't have one handy.
>
>
> > For example, here's a Local interface for a CMP 2.0 Entity bean:
> >
> > public interface UserLocal extends EJBLocalObject {
> >     public String getId(); // CMP method
> >     public void setId(String id); // CMP method
> >     public String getName(); // CMP method
> >     public void setName(String name); // CMP method
>
>
> >     public Collection getFriends(); // CMP method
> >     public void setFriends(Collection friends); // CMP method
>
>
> Those two cannot be directly exposed if they are the same
> signatures as the abstract getter/setter methods in your 2.0 CMP bean.
>
>
> >     public void addFriend(UserLocal friend); // business method
> >     public void removeFriend(UserLocal friend); // business method
> > }
> >
> > Thanks,
> > David
> >
> >
===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> > of the message "signoff EJB-INTEREST".  For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> >
> >
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to