Collection delete and all child entities

Posts: 35
Joined: 22-May-2006
# Posted on: 29-Mar-2007 23:58:30   


I need to be able to retrieve a collection of Entity_A where they are older than x days. I then need to be able to delete them (DeleteMulti) and have that delete all of the child related entities, Enity_B and Entity_C.

In LLBLGen I have relationships defined between the Parent and child entities. There are also two other relationships for lookup tables that are many to one.

My question is if I call DeleteMulti will it delete all of the child entities of this Parent and if not, how can I accomplish this.



Posts: 934
Joined: 12-Feb-2004
# Posted on: 30-Mar-2007 02:32:58   

I don't believe there is any recursive delete feature in LLBLGen. To accomplish this you can setup the database cascade the deletes like you are asking. Another solution would be to delete the child collections by hand and then the parent, but this would have to be done by hand.