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

[Solved] Forward mapping a List<>

1 Answer 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
sitefinitysteve asked on 08 Apr 2010, 06:53 PM
I have a bunch of nested objects...so ...

Class can itself contain a list of Class objects to create a hierarchy...

Ok, so I do

Class class1 = new Class();
class1.Items.Add(new Class());
class1.Items.Add(new Class());

So "class1" contains two child class objects and those get persisted to the database.

Is there any way inside those two class objects to figure out what the parent object is?

Does that make sense?





1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 08 Apr 2010, 09:19 PM
Hi Steve,

there are two principal ways to store a collection with OpenAccess: with join table or with inverse reference.
The latter one is not able to maintain the list position, so the list is more like an unordered collection. But the big advantage is that using the inversely stored collection allows to use - the inverse reference. Please see http://www.telerik.com/help/openaccess-orm/mapping-properties-one-to-many-reference-without-join-table.html for more details.

Kind regards,
Thomas
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Thomas
Telerik team
Share this question
or