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".

Reply via email to