>* Use CMP, do nothing, and let the container figure out how to maintain
>references
>
>If possible, I prefer the last one, as it requires the least amount of
>coding. Clean and simple. Most OODBS-based containers should be able to
>do this (I believe Gemstone handles this to perfection).

I also strongly prefer that approach (using entity references as attributes
rather than primary keys or handles), and all containers should support this
since it is required by the spec for CMP.  Different containers will undoubtedly
provide different approaches for how such references can be persisted, and can
provide the deployer with options to choose from for just how to persist these
entity references. One natural option for mapping such references to a DB is to
simply store the primary key in the DB. That works either when that attribute
will always refer to a bean created by the same home, or when there is other
state that allows the container to know which home the reference is for (for
example, in a table of Employees, there could be a column indicating whether the
employee is a Manager or not, where Manager is a subclass of Employee). For
other cases, the container could provide an option to persist the bean reference
as a combination of primary key and an identifier of the Home.

Erik Voldal
Email: [EMAIL PROTECTED]
Phone: 507-253-4788

===========================================================================
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