RE: Entity Bean with refs to other Entity Beans?Yes, it is an EJB standard -
the CMP spec defines that a container must handle persisting:
1) primitives
2) Serializable objects
3) Entity references

Persisting  of Lists, Maps, Sets or persisting based on an objects
properties etc (OR-mapping) is not (yet) part of the standard but will be
more clearly defined in EJB 2.0.

For your other q; there is nothing wrong with the sample code you provided
(fully legal).

Hope it helps. :)

/Magnus Stenman, the Orion team


----- Original Message -----
From: Byron du Preez
To: Orion-Interest
Sent: Friday, April 14, 2000 7:51 AM
Subject: RE: Entity Bean with refs to other Entity Beans?


>No, no such thing is required - just make the field be of the remote
>interface type (ejbLoad/ejbStore is still empty) and it will be persisted
as
>the primary key of the entity in the db.
>/Magnus Stenman, the Orion team
Very neat feature.
1). Is this automatic persistence of associated entity fields an EJB
standard or an Orion addition (which should be an EJB standard)?
2). How do you set such a field?
  class PortfolioEntity extends EntityBean

    public Client client;  // Remote interface to ClientEntity
    public Client getClient() { return client; }
    // METHOD A
    public void setClient( Client client ) { this.client = client; }
    // METHOD B
    public void setClient( Long clientID )

      try

         this.client = getClientHome().findByPrimaryKey( clientID );
      }
      catch( Exception ex ) { ... }
    }
}
Is it possible to use METHOD A (my understanding is that one can't pass
around RMI remote references within the same JVM) or do we have to resort to
using primary keys (as in METHOD B) to set an associated bean?
Thanks in advance
Byron du Preez


Reply via email to