[odb-users] Composite pattern (not composite value) with extra pointer to a child

Boris Kolpackov boris at codesynthesis.com
Mon Mar 16 09:23:55 EDT 2015


Hi Alexandre,

Alexandre Pretyman <alexandre.pretyman at gmail.com> writes:

> So it seems that for this scenario odb must be part of wiring of
> the object pointers.

Quoting from Chapter 6, "Relationships":

"When persisting or updating an object containing a pointer to another object,
 the pointed-to object must have a valid object id. This, however, may not
 always be easy to achieve in complex relationships that involve objects with
 automatically assigned identifiers. In such cases it may be necessary to
 first persist an object with a pointer set to NULL and then, once the
 pointed-to object is made persistent and its identifier assigned, set the
 pointer to the correct value and update the object in the database."

Boris



More information about the odb-users mailing list