I think you can do this without any problems in a BMP but not in CMP.
IMHO you would need a table that maintains user-friends relacionship
and, although some app servers support multitable CMP, it�s not portable.

David Levine wrote:

> Can an entity bean contain a Collection of references to other entity
> beans
> of the same type?
>
> What would the deployment descriptor look like?  Especially in the
> relationship area.
>
> 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
>
>     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".

Reply via email to