One to one relationships

Thread is closed for posting
7 posts, 0 answers
  1. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 14 Apr 2009 Link to this post

    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.
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 14 Apr 2009 Link to this post

    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.
  3. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 15 Apr 2009 Link to this post

    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.
  4. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 15 Apr 2009 Link to this post

    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.
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 16 Apr 2009 Link to this post

    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.
  6. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 20 Apr 2009 Link to this post

    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.
  7. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 22 Apr 2009 Link to this post

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