That's the way it's done with Inprise's App Server. I'd be interested to
hear from others who do it differently.
Note: Be sure to also include an <ejb-ref> link to the Organization entity
bean in the deployment descriptor.
jim
----- Original Message -----
From: Laird Nelson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 22, 2000 4:35 PM
Subject: Entities and relationships
> The specification states:
>
> "The current EJB architecture does not specify how one Entity bean
> should store an object reference of another Entity bean. The desirable
> strategy is application-dependent. The enterprise bean...can use any of
> the following strategies for maintaining persistently a relationship
> between entities (the list is not inclusive of all possible strategies):
> * Object's primary key. This is applicable if the target object's Home
> is known and fixed.
> * Home name and object's primary key.
> * Home object reference and object's primary key.
> * Object's handle."
>
> I have an entity bean, whose bean class is named OrgUnitBean and whose
> remote interface is named OrgUnit, that must notionally have an
> Organization passed to it when it is created. Organization is, however,
> another entity bean (its remote interface is named Organization and its
> bean class is named OrganizationBean). What should my ejbCreate()
> method in OrgUnitBean look like, and what should the member variables in
> OrgUnitBean look like?
>
> Can I have an ejbCreate method like this:
>
> public String ejbCreate(Organization owner, String name) {
> this.org = owner;
> this.name = name;
> return name;
> }
>
> ...and can OrgUnitBean keep a reference to Organization in it like this:
>
> private Organization org = null; // assigned by ejbCreate; see above
>
> ...?
>
> Cheers,
> Laird
>
>
===========================================================================
> 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".