Title: 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