Telerik Forums RSShttp://www.telerik.com/urn:uuid:af9b617a-6bc9-4411-98cc-f3562f768ecfhttp://www.telerik.com/forums/permalink/emGbr8lrEUSYzPNWL3aOzwTwo classes to show data from one TableHi Alex,<br />
<br />
There is not so much to be done but here are the steps:<br />
&nbsp;- Create a view in the database and include the columns you want to be mapped to the new class;<br />
&nbsp;- Use the <a href="http://www.telerik.com/help/openaccess-orm/openaccess-tasks-model-tools-update-data-model-db-changes.html" target="_blank">Update from Database wizard</a> to update the domain model and include the newly created view;<br />
&nbsp;- Now you should be able to see the view in the <a href="http://www.telerik.com/help/openaccess-orm/developemnt-environment-wizards-dialogs-model-tools-designer-model-schema.html" target="_blank">Model Schema Explorer</a> pane. Just drag it to the design surface and a new persistent class will be created;<br />
&nbsp;- If you save the diagram, an error should be shown that the new class does not have an identity member. In order to work correctly OpenAccess requires that all persistent classes in the model have identity members. So you will have to manually set one or more properties as identity members for the new class. The requirement is that the identity member (or the combination of several identity members) can identify uniquely each persistent object. In your case the IdPerson column should be enough if the Person - Address relation is one-to-one. You can follow <a href="http://www.telerik.com/help/openaccess-orm/openaccess-tasks-model-tools-validate-data-model.html" target="_blank">this article</a> in order to resolve the validation error. <br />
<br />
Hope that helps.<br />
<br />
Kind regards,<br />
Alexander <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
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 <a href="http://www.telerik.com/support/pits.aspx">
Telerik Public Issue Tracking</a>
system and vote to affect the priority of the items
</div>
<div class="forumBaloonBottom"></div>urn:uuid:0cc1b77e-c3d3-45ce-8172-96c59b5c5eddhttp://www.telerik.com/forums/permalink/frfBDNPDzkWBcpbFm1xe3QTwo classes to show data from one TableHello Alexander,<br />
<br />
I am using the visual designer.<br />
<br />
Thank you.urn:uuid:453c7aa7-516f-4287-b7a3-5eb39fb88fb9http://www.telerik.com/forums/permalink/p3o8RW9Rh0K3o16zn7iPuQTwo classes to show data from one TableHi Alex,<br />
<br />
I am afraid that mapping two persistent classes to the same table is not possible. You can however, create a View in the database that exposes the Address-part of the columns and create a persistent class against this view. You will be also able to create a relationship between the two classes. <br />
Please let us know if you need more details on how to accomplish this and tell us whether you are using the new visual designer or the "classic" wizards.<br />
<br />
Greetings,<br />
Alexander <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
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 <a href="http://www.telerik.com/support/pits.aspx">
Telerik Public Issue Tracking</a>
system and vote to affect the priority of the items
</div>
<div class="forumBaloonBottom"></div>urn:uuid:956539e6-4cc6-462d-af4a-4260221d6d95http://www.telerik.com/forums/permalink/5jlllcZMLUavSkJgIh1tlQTwo classes to show data from one TableHello,&nbsp;<br />
<br />
I have a Table Person with the fields:<br />
IdPerson | Name | Birthday | Street | City | State | ZIPCode | ...<br />
<br />
I would like to create the class Person, but separate the address data in a different Class.&nbsp;Is it possible with Telerik ORM?<br />
<br />
----------------------------<br />
Person ( Id, Name, Birthday)<br />
|<br />
hasAddress<br />
|<br />
Address( Street, City, State, ZIPCode) and Probably IdPerson to relate the classes<br />
--------------------------------------<br />
<br />
<br />