Please, read my response below...
Chip Wilson writes:
> > How does the EJB container handle a situation where
> > a particular table has the ON DELETE CASCADE referential
> > integrity constraint. That is when a parent record (entity
> > bean) is removed on the container side, that record along
> > with all it children record are deleted on the DB side.
> >
> >
> [Chip Wilson]
> The use of a cascade delete rule is a strong indication that the
> parent and child objects have the same lifetime, which is almost always
> composition in UML terms. A composite should not be implemented as multiple
> entity beans, but as a single entity. In EJB terms, the composed object(s),
> represented by the child record(s), are called dependant objects, and there
> are explicit statements in the 1.1 draft discouraging the implementation of
> dependant objects as separate entity beans.
Our model has aggregation relationships all the way:
NetworkElement contains Frames,
Frame contains Shelves,
Shelf contains Cards,
Card contains Ports,
Port contains Terminals,
Terminal contains TerminationPoints
...
As you can see, from your suggestion it appears that we would
implement a single entity bean NetworkElement, and all the other
objects (frame, shelf, card, port, terminal) would be implemented as
dependent objects (not entities). This is not feasible, as
the business logic (which is inside the session beans) will
at different points in time perform transactional operations on
isolated Ports or Shelves. The transaction requests on isolated objects
(cards or ports or shelves) make these objects transactional and
independent in nature, NOT dependent objects. These objects
are only dependent in the context of their containmnet relationships
during creation or deletion. But except for creation and deletion,
most operations on them can be independent of their parents.
For instance, I can set a particular TerminalParameter. And
this operation does not have any impact on the Terminal parent
(port). That is Port and Terminal are independent in this context.
The only dependence really occurs when Port is deleted; which implies
deleting all its terminals. And when a terminal is created which
implies telling terminal who its PORT parent is.
Rubens.
===========================================================================
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".