I suggest you read chapters 1-5 (in particular 4-5) of the Expert 2008 Business Objects book, as it walks through parent-child class relationships pretty clearly. You might also look at chapter 18, which discusses data access.
The Core CSLA .NET 3.8 video series (videos 2 and 3) also cover parent-child relationships in some detail.
The root object is the only thing directly saved by the data portal. The root object needs to call the data portal (or in a BusinessBase the FieldManager, or in the case of a BusinessListBase, the base class) so the data portal invokes Child_XZY methods on each child object.
Only the root object will have DataPortal_XYZ methods, the child objects will have Child_XYZ methods.
Normally the root object passes a reference to itself to the data portal when saving the child objects, so the child objects have access to the root object's properties (like its Id property).
This only works, of course, if you've already set the root object's Id property before triggering the save of the child objects.
jsavold:
The order object get a temp id until it is saved through the parent. After Save() is called the child object in the collection has the new id from the DB but the original object still has the temp id. How do get the order object and the child order to point to the same object?
Copyright (c) Marimer LLC