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

One to one relationships

6 Answers 131 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.
richardFlow
Top achievements
Rank 1
richardFlow asked on 14 Apr 2009, 01:27 PM
Hi, How best do i represent one to one relationships.  I know its not the most desirable way to design a database but its what we are stuck with and i want to link them using openaccess.

I get the following error when using LINQ on these references.

Field 'navisionSKUSyncStatus' on LightingEnterprises.LightBase.Admin.SKU is not a reference to another PC class

Regards,

Richard.

6 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 14 Apr 2009, 05:22 PM
Hello Web Belief Ltd,
It llook to me like a mixture of problems. One is 1:1 and one is your linq statement. Can you give me an example app that shows the problem? Or at least the exact linq statement and the necessary model information.

If you use reverse engineering you can map 1:1 like 1:n and just make sure that the collection only contains one entry. In the linq statement you have to use the collection query way on one side.

Sincerely yours,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
richardFlow
Top achievements
Rank 1
answered on 15 Apr 2009, 05:32 PM
Hi Jan,

As i investigate further it seems to me to be a bug in the reverse mapping wizard.

When i create a reference on a class and it displays the field to column mapping table, anything i enter in the 'Column' column does not get generated on the reversemapping.config file. Or at least, it is blank again when i reload the mapping wizard.

Is there a known issure with this?

Regards,

Richard.
0
richardFlow
Top achievements
Rank 1
answered on 15 Apr 2009, 05:52 PM
Hi Jan,

Just to confirm,

when i update the app.config file (after running the reversemappnig wizard) and enter the likes of the following section:

<field name="range">
  <extension key="db-column">
    <extension key="db-type" value="INTEGER" />
    <extension key="db-column-name" value="RangeUID" />
  </extension>
</field>

then it works as desired. The reverse mapping wizard has a bug. I'm on Q1 SP1.

Regards,

Richard.
0
Jan Blessenohl
Telerik team
answered on 16 Apr 2009, 04:29 PM
Hello Web Belief Ltd,
That really looks like a bug, can you send me an example schema that is showing the behaviour? I am not sure about the reference definition, which constraints I need,...

All the best,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
richardFlow
Top achievements
Rank 1
answered on 20 Apr 2009, 09:46 AM
Basically, when i update the reverse mapping file using the wizard, any new reference fields don't get created. The relevant section in the reversemapping.config does not get created at all. It doesn't matter what table i do it on.

I'm sorry, i'm not back at my development PC these days to provide more details - but i'm fairly certain there is a bug.

Regards,

Richard.
0
Jan Blessenohl
Telerik team
answered on 22 Apr 2009, 12:46 PM
Hi Web Belief Ltd,
Are you using the reverse engineering merge functionality? You have to explictly merge teh schema changes into your existing reverse mapping. In the merge dialog you should see your new columns and the actions that we do on your model. Can you see those entries?

All the best,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
richardFlow
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
richardFlow
Top achievements
Rank 1
Share this question
or