This is a migrated thread and some comments may be shown as answers.
Does not reference any columns or members from the target entity.
1 Answer 12 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 08 Feb 2012, 04:55 PM
I have a many-to-many relationship between two tables: Packages and PackageSites. The relationship table is called Packages_PackageSites. I'm getting the following warning:

The association for the join table with name 'Packages_PackageSites' does not reference any columns or members from the target entity.

What does this error mean? When I double click on warning to take care of it, it asks me to select the join table columns that point to the child table. There isn't really a "child" table in a many-to-many relationship. Suggestions?

I've noticed that PackageSite.Packages.Add(package) works, where as Package.PackageSites.Add(packageSite) does not. Does that have something to do with this?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 10 Feb 2012, 04:02 PM
Hi Chris,

 In the OpenAccess metadata, when you have a many-to-many association, even though logically, both association endpoints have equal meaning, one is always the lead part, or the source of the association. The other part of it is the target of the association. 

We can definitely improve the validation message as the relation is really not a parent-child one but more a source-target one.

The warning however, states that there are no columns in the join table that point to the target of the association. You should be able to pick those columns. If your Package and PackageSites entities have single Identity members(no multiple keys in the database) this warning will not affect the runtime of OpenAccess and you can just ignore it.
In case there is single identity property, the OpenAccess runtime will automatically detect the join-table relation. That is actually the reasonwhy this is just a warning and not an error.

You actual issue, that inserting Package.PackageSites.Add(packageSite) does not work, is probably caused by another setting. You should check the 'Managed' setting of your association endpoints, the IList<T> navigation properties in the designer. If you would like to be able to insert from both sides of the association, you should have both of those members marked with Managed=true. This is valid only if my assumption is true, that by "does not work", you mean that no data is inserted in the join table. If there is an exception on insert, than the reason is probably different and will need further investigation.

Regards,
Zoran
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or