in

The ORM Foundation

Get the facts!

Composite Keys

Last post Tue, Feb 28 2017 15:47 by Ken Evans. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • Tue, Feb 28 2017 2:08

    • Steve Miller
    • Top 50 Contributor
      Male
    • Joined on Thu, Jan 1 2009
    • Portland, Oregon USA
    • Posts 18

    Composite Keys

    Greetings,

    I know this will be a very uneducated question... Not because I haven't tried to educate myself by looking at the tutorials and reading Terry's Big Brown Book... I just can't figure it out.

    I have two entities that I would like to use in a composite primary key.  If someone could point me to the correct tutorial or give me a short step-by-step example of how this can be done, I'd be eternally grateful.

    Cheers, Steve 

    Filed under:
  • Tue, Feb 28 2017 14:55 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: Composite Keys

     Hi Steve,

    Let's try a generic answer first.

    1: Make one or more atomic statements that include your two "entities" as object type names.

    2: Put the statements into NORMA.

    3: Add appropriate constraints

    4: Look at the Relational View.

    If you got the constraints right, then NORMA should generate relations that include the two entity names as keys in the relations.

    You can also use NORMA to generate the DDL.   

    Note: ORM uses "Object Types" which are not the same as "entities" in the ER paradigm.

     Ken

  • Tue, Feb 28 2017 15:07 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: Composite Keys

    Hi Steve,

    Your registered email account is being rejected by  the "remote host" with the message "Recipient not found".

    Please update the email address in your ORM Foundation account.

    Ken   

     

  • Tue, Feb 28 2017 15:22 In reply to

    • Steve Miller
    • Top 50 Contributor
      Male
    • Joined on Thu, Jan 1 2009
    • Portland, Oregon USA
    • Posts 18

    Re: Composite Keys

     Hi Ken,

     Thanks for getting back to me!

    1) I will try to follow your steps on creating the composite key.  Thank you.

    2) I have updated my profile to include my new address.  I sold miller.com last year and have the old email address sprinkled from here to the moon and back.  I update them as I find they are broken!  Thanks for pointing this out.

    Cheers,

    Steve 

  • Tue, Feb 28 2017 15:31 In reply to

    • Steve Miller
    • Top 50 Contributor
      Male
    • Joined on Thu, Jan 1 2009
    • Portland, Oregon USA
    • Posts 18

    Re: Composite Keys

     Ahhhhhhh...  I was trying to use value types instead of object types to apply the uniqueness constraint to...  I thank you for your quick response and a gentle nudge towards the solution (which was, as I suspected, very simple.  When I went back to the Big Brown Book and looked it up again, I saw the error in my ways!

     Stick out tongue

    Cheers, Steve 

  • Tue, Feb 28 2017 15:47 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: Composite Keys

     Hi Steve,

    You have to update the "private email" in your profile as well as the public email (which is optional).

    I have updated this for you so no further action needed on your part.

    Ken

     

     

Page 1 of 1 (6 items)
© 2008-2024 ------- Terms of Service