Can't create an association

8 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 20 Dec 2010 Link to this post

    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
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 21 Dec 2010 Link to this post

    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.
  3. DevCraft banner
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 21 Dec 2010 Link to this post

    My bad!

  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 21 Dec 2010 Link to this post

    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.
  6. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 21 Dec 2010 Link to this post

    They are defined as identity columns in the DB.

    -- 
    Stuart
  7. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 21 Dec 2010 Link to this post

    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.
  8. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 04 Jan 2011 Link to this post

    It seems that marking it as an identity column isn't enough for OA; you have to make the column a Primary Key.

    -- 
    Stuart
  9. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 07 Jan 2011 Link to this post

    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.
Back to Top
DevCraft banner