Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent-Child Delete?
Message
From
02/07/2008 14:21:13
 
 
To
02/07/2008 09:03:00
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01328201
Message ID:
01328333
Views:
10
I don't think I understand the delete process in the framework.

I have an entity with 20 records "ReportReturnSum". In this scenerio I have 20 child records in the "ReportReturnHeader" table with a 1-to-1 relationship to the "ReportReturnSum" table.

I would think that as each record in the "ReportReturnSum" entity is deleted my

Protected Overrides Sub HookParentNavigated(ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
Me.GetReportReturnSumByFK(CType(e.PrimaryKeyValue, Guid))
End Sub

method would be called for each record in "ReportReturnSum" as it is being deleted.

The only method that gets fired in my "ReportReturnHeader" BO is the

Protected Overrides Sub HookParentRetrieved(ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
Me.GetReportReturnSumByFK(CType(e.PrimaryKeyValue, Guid))
End Sub

method when the "ReportReturnSum" entity is filled by

Public Function SelectReportReturnSumByCaseFK(ByVal CasePK As String) As mmBindingList(Of ReportReturnSumEntity)
'Get a dataset of the data we want to delete
Me.GetEntityList("Select * From ReportReturnSum Where rrs_chdGUIDFK = @CasePK", Me.CreateParameter("@CasePK", CasePK))

Return Me.EntityList
End Function

Since the "ReportReturnHeader" HookParentRetrieved method is fired when the entity is filled only one record in "ReportReturnHeader" is being deleted.

Do I have to loop through my "ReportReturnSum" entity and delete each entity 1-by-1 to get the children of that entity to delete too?

Thanks

-Bob S.
Previous
Reply
Map
View

Click here to load this message in the networking platform