AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

GrandChild Updating Issue #564

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please see 
http://community.codesmithtools.com/Template_Frameworks/f/68/t/11813.aspx for 
more information

I have a table with the following fields/keys:

Table: ProjectUserMember
Fields: ProjectID, UserID, EmployeeID

FK's: ProjectID/UserID to ProjectUser table and EmployeeID to Employee Table

With this setup no AssociatedOneToMany property gets generated in 
ProjectUser.Generated.vb...Why?

If I remove the EmployeeID to Employee table FK it does generate but is 
strangely named ProjectUserMembersProjectUserMembers.

Original issue reported on code.google.com by eslater%...@gtempaccount.com on 8 Mar 2011 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
I think I have finally figured everything out in my head and what it boils down 
to is that if you have a GrandChild situation the object that is second in the 
chain will generate the error on the call to FieldManager.UpdateChildren 
because it has a legitimate child collection and a child object to its parent 
which unless it is switchable will not implement ChildUpdate.

I think the only reasonable solution is to avoid GrandChild situations because 
the only other solution is to not generate the OneToMany Associations which is 
not really a realistic answer.

Original comment by bniemyjski on 10 Mar 2011 at 12:37