Hi -
Please help me jump-start the conversion of the approach that I have been using to retrieve Child and Grandchild collections in my Parent Business Objects.
I've reviewed the Pre-fetch info in the documentation, but I'm not clear about the best practice for implementing:
One Round trip to the database to retrieve 1 parent and all it's childeren ...
It is currently implemented with a stored procedure or set of SQL statements that return the hierarchy ...generating multiple result sets ti a data reader
The pattern is to:
Capture the single Parent row and populate the properties of the Root object ( I'm currently processing the root BusinessObject using a TypedView).
After executing a datareader.NextResult() command another method in the Root constructor is called LoadChild(datareader) ... those child rows are processed in the
Load Child(datareader) function.
If GrandChildren are contained in the Root object the Root constructor then does another datareader.NextResult() and calls LoadGrandChild(datareader).
I did review the Pre-fetch documentation, but it seems that the topic that I reviewed started with pulling the Root object after retrieving a collection of children ( get the Customer after Retrieving invoices).
Let me know if you need more details. Hopefully this is a common design issue with a documented best practice.
Thank you,
Steve