Save Recusive with m:n relation

Posts   
 
    
trungtt
User
Posts: 5
Joined: 23-Mar-2007
# Posted on: 23-Mar-2007 15:23:09   

I have 3 table - Car - Employee - EmployeeOnCar

They have m:n relation

Now:

1/ I add new car entity (carEnt) 2/ I add new Employee for Car (carEnt.EmployeeCollectionViaEmployeeOnCar.Add(new EmployeeEntity("JOHN")) 3/ I save (carEnt.Save(true))

But save only Car entity EmployeeOnCar not save

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 23-Mar-2007 15:34:38   

Please check the question "How do I create a m:n relation between two entity objects? " in the "Best practises -> How do I...?" section of the LLBLgen Pro manual.

trungtt
User
Posts: 5
Joined: 23-Mar-2007
# Posted on: 23-Mar-2007 17:31:01   

I dont said about create m:n relation I am saying about Save Recusive feature in m:n relation

if u have 1:n link

A<B<C -> A.save(true) -> B.save() -> C.save()

I have m:n link

A<B>C

add A, Add multi B , not add C , i can not save recusive

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 24-Mar-2007 00:41:30   

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6386&HighLight=1 The M:N related collections are read-only and not saved. This thread is along the same lines.