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

Reply via email to