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

Adding Association to Sub-Class

2 Answers 61 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jamie
Top achievements
Rank 1
Jamie asked on 23 Jul 2012, 10:20 AM
Hi,

I currently have a vertical hierarchy for three classes a -> b -> c. The hierarchy seems to model correctly using vertical inheritance, a primary 'ID' property added to (a). When I want to add an association for a separate table (lets call it d!) to an inherited table (in this case b) I can't reference the primary ID field in the drop down list of the association editor - all the local properties for b are listed, but none from a, specifically not the primary key that I need.

From earlier posts, it appears that this ought to be possible, but I can't see an obvious mechanism. Am I missing something here?!

Thanks,

J.

2 Answers, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 25 Jul 2012, 03:20 PM
Hello Jamie,

If you just choose 'Default' in this case, you should be able to proceed without problems during runtime. The OpenAccess runtime automatically finds the primary key property of the corresponding class and relates the foreign key of "d"  to that primary key. The other way to achieve more precise definition during design time would be, if you have your tables defined, to use the relational view of the association editor where you could chose the correct column of the "b" table. That is however, not necessary for scenarios where you have a single id field declared in the base class.

Kind regards,
Zoran
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
0
Jamie
Top achievements
Rank 1
answered on 26 Jul 2012, 08:37 AM
Hi Zoran,

Ah, I see - I had wondered how the 'Default' option actually works, thanks for explaining! And I see what you mean about the relational editor as well, that makes sense.

Thanks for your help and prompt response.

Thanks,

J.
Tags
Design Time (Visual Designer & Tools)
Asked by
Jamie
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Jamie
Top achievements
Rank 1
Share this question
or