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

Can't create an association

7 Answers 76 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 21 Dec 2010, 12:49 AM
I've a model that includes the 2 tables shown in ss1.jpg.

I want to create an association between trainingsession.id and traningsessionattendee.sessionid. If I use the association toolbox item from the toolbox I am presented with ss2.jpg which is different from the dialog that the docs tell me to expect and I can't seem to do anything that will actually create the association.

Can anyone shed any light on this please?

-- 
Stuart

7 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 21 Dec 2010, 07:46 AM
Hello Stuart Hemming,

It seems the screenshots did not get attached. Could you please try sending them again?

Kind regards,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Stuart Hemming
Top achievements
Rank 2
answered on 21 Dec 2010, 10:25 AM
My bad!

0
Alexander
Telerik team
answered on 21 Dec 2010, 05:36 PM
Hello Stuart Hemming,

It seems the two classes do not have identity properties which may cause such behavior. Please select the TrainingSession.ID and TrainingSessionAttendee.ID members and from the Properties pane change their Identity option to true. Then you should be able to drag an association from the TrainingSessionAttendee to the TrainingSession class and see only one row in the Define Relationship dialog where the TrainingSessionAttendee.SessionID and TrainingSession.ID properties can be mapped.

All the best,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Stuart Hemming
Top achievements
Rank 2
answered on 21 Dec 2010, 05:39 PM
They are defined as identity columns in the DB.

-- 
Stuart
0
Alexander
Telerik team
answered on 21 Dec 2010, 05:45 PM
Hi Stuart,

It is possible that OpenAccess has not read that information from the database. Normally the identity members are marked with a different icon on the diagram - one that illustrates a key. Please try what I suggested and let me know if it does not help.

Kind regards,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Stuart Hemming
Top achievements
Rank 2
answered on 04 Jan 2011, 07:20 PM
It seems that marking it as an identity column isn't enough for OA; you have to make the column a Primary Key.

-- 
Stuart
0
Alexander
Telerik team
answered on 07 Jan 2011, 10:41 AM
Hi Stuart,

This should not really be the case, I verified by looking into the code that the only restriction for the columns shown on the target end of the association definition dialog is that they are mapped to identity fields. However, we are happy to see that you have managed to solve the problem.

Greetings,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Getting Started
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Alexander
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or