in

The ORM Foundation

Get the facts!

On FKs and Subtype PKs

Last post 03-28-2009 15:45 by Juan Ignacio Gelós. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-28-2009 15:37

    Huh? [:^)] On FKs and Subtype PKs

     Hi all,

    This post was already answered by Matthew Curland (I'm including his answer as a reply below), I'm posting it again as a reference in case someone else has the same issue.

    ----

     

    In the diagrams below, note the two "Id" columns in table División: Id1 and Id2. d2 is a FK to the Empresa table's PK, which in turn it's this subtype's FK for its Entidad supertype's PK.


    Also in table Empresa, notice the column DueñaId.


    Having the DefaultPopularReferenceModeNames settings shown in the image, I would have expected the hird column's name in table División to be "Empresa", and column Empresa.DueñaId to be named "Dueña".


    Do I have any way to prevent these two issues? The Id1, Id2 column names happen in a couple more relational tables througout the rest of the diagram. I won't be able to live with those in the final production database, so I will end up just renaming the column in the relational view, with the accompanying annoyances of having to rename them each time the model is refreshed...


    (HELP!)

     

     

     


    Juan Ignacio Gelós
    Evolutio Software
    http://www.evolutio.com.ar
  • 03-28-2009 15:43 In reply to

    Re: On FKs and Subtype PKs

     Attaching: complete model file:  Base.orm

    Juan Ignacio Gelós
    Evolutio Software
    http://www.evolutio.com.ar
  • 03-28-2009 15:44 In reply to

    Re: On FKs and Subtype PKs (reply from Matthew Curland)

    Answer

     

    By Matthew Curland in Open Discussion & Feature Requests

    Yes, it's a bug. The name generation code treats a reference from a separated subtype table as an identifier instead of a reference, and this code was kicking in for your case (a reference to a separated table) as well.

    This is fixed in changeset 1374 on sourceforge.

    -Matt

    Juan Ignacio Gelós
    Evolutio Software
    http://www.evolutio.com.ar
  • 03-28-2009 15:45 In reply to

    Re: On FKs and Subtype PKs

     Thanks Matthew, gonna try the next release.

    Juan Ignacio Gelós
    Evolutio Software
    http://www.evolutio.com.ar
Page 1 of 1 (4 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service