The ORM Foundation

Get the facts!

uniqueness constraints vs idetifiers

Last post Mon, Oct 20 2008 9:57 by Terry Halpin. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Sat, Oct 18 2008 5:13

    • rolemo
    • Top 25 Contributor
    • Joined on Sun, Oct 12 2008
    • Posts 38

    uniqueness constraints vs idetifiers

     Well I’m back…I’m still fumbling with them uniqueness constraints. I think my misunderstanding evolves from confusing the uniqueness idea with what might be termed “identifier”. You see till now we used to denote an identifier value (usually an EmpID for employees or ModuleID for modules, etc.) which we called unique as it is unique in the whole system. Now ORM’s uniqueness constraint marks a combination of entities as unique (Academic holds a Chair), from the perspective of one of the participants (e.g. the Academic, who is allowed to hold one Chair at a time) or both (if only one Academic can hold each Chair, as may be indicated by two uniqueness constraint, one above both roles of the binary).

    But how can I express the identifier concept? How can I express the fact that one (or more) entity/value is the identifier of that Academic in my system? The uniqueness constraints wouldn’t suffice, as obviously I will not use the Chair as the identifier of an Academic, but the EmpID (as I do with ll the rest of the Employees, all of whom has an  EmpID but not are Academic and hold Chairs).

    So what am I getting wrong here?


    Filed under: ,
  • Mon, Oct 20 2008 9:57 In reply to

    Re: uniqueness constraints vs idetifiers

    Hi Rolemo

    In this example, EmpNr is the identifier for Employee. If you declare a reference mode for an entity type, that provides its preferred identifier. The expression Academic(.empNr) is short for the 1:1 mandatory existential fact type "Academic has / is of EmpNr()".



Page 1 of 1 (2 items)
© 2008-2020 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service