Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design Question?
Message
De
21/09/2004 14:09:31
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00943758
Message ID:
00944660
Vues:
15
Kevin,

Yes I store the primary key of the parent into the child records. And, I have used the auto-populate of foreign keys into child biz objects. However this only works for ONE parent record at a time. If there are more that one parent record in the primary dataset only the first row is updated with its child records. The remaining child records are not populated with their respective parent foreign keys.

I want to be able to update a batch of parent child records at one time.

The framework retrieves the parent primary key on the update of the parent so it follows that multiple calls to update must be made when more than one parent row is in the batch. I don't know how to implement this using the native MM biz objects. How would the transaction be handled?

I have been thinking about trying to build one data set with parent and child rows, set a relation and let ADO cascade the pks. With this scenario I could update the batch with one Update command and transaction object.

This issue only applies to creating a batch of parent and child records. The typical one parent many child rows is handled very nicely by the framework.

If anyone has any experience or ideas on how to proceed, they would be appreciated.

Terry Carroll






>Terry,
>
>>I would like to get some opinions on how to use MM biz objects to add relational data in a batch process.
>>How would you design a method to add invoice and invoice line records from a query of Orders and order lines using MM biz objects? OrderBiz, OrderLineBiz, InvoiceBiz ,InvoiceLineBiz
>>
>>From what I have learned so far, I don’t think MM biz objects can be used in this scenario because they do not handle batch updates of foreign keys. I hope I’m wrong and someone can point me in the right direction. ADO.NET will handle cascading keys and I know I can write all the code to accomplish this but I would like to maximize the MM biz objects.
>
>Are you storing the primary key of the parent into the child records? If so, you can register one business object as the child of another business object, and set the ForeignParentKeyField property of the child to the corresponding parent object's primary key field. When you do this, the PopulateForeignParentKeyField() method is automatically called when the child records are saved.
>
>Regards,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform