This is a migrated thread and some comments may be shown as answers.

'Bill-of-Materials' generated validation error

2 Answers 32 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig
Top achievements
Rank 1
Craig asked on 15 Nov 2011, 01:15 PM
Hi,
I've created a domain model from an existing database and have a validation error for a 'Bill-of-materials' construct. The error is "The MetaJoinTableAssociation SurveysHasSurveys1 can not be created. The foreign key column ParentId of the SURVEY_HISTORY join table points to the master and child tables at the same time" where ParentId is the parent survey id and SURVEY_HISTORY 
is a key only table that contains the links between the surveys i.e. is a hierarchy of surveys.

SURVEY table declared like this in SQL Server
SurveyId (PK)
... other columns

SURVEY_HISTORY table declared like this in SQL Server
ParentId (PK2, FK)
SurveyId (PK1, FK)

At this point the SURVEY domain class has two collections, one for each reference from SURVEY_HISTORY.

What do I need to do to implement this hierarchy correctly?
Regards
Craig

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 15 Nov 2011, 04:15 PM
Hello Craig,

This problem has been fixed and the fix will be part of the Q3 release, expected later this week. 

However, you should be able to fix the error even now, without upgrading to the new version. Just double-click on the association to open the Association Editor and correct the mapping between the columns of the two tables, probably at the moment the ParentId column is used for a second time, instead of the SurveyId column.
After saving the changes the error should go away. I hope that helps.

Kind regards,
Alexander
the Telerik team
Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
0
Craig
Top achievements
Rank 1
answered on 15 Nov 2011, 04:26 PM
Thanks Alexander,
I thought it would be something simple.
Added association table back in to get access to the column names and error resolved.

Regards
Craig
Tags
Data Access Free Edition
Asked by
Craig
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Craig
Top achievements
Rank 1
Share this question
or