Re: Cayenne modeler - need to generate setters and getters for primary key

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Mar 10 2005 - 10:15:48 EST

  • Next message: PA: "Re: Cayenne modeler - need to generate setters and getters for primary key"

    > On 3/10/05 3:04 AM, "Jürgen Saar" <jsaa..eb.de> wrote:
    > > But this only makes sense for connecting cayenne to
    > > 'historically grown' projects ... new projects should
    > > not have meaningful PKs

    Kevin Menard <kmenar..ervprise.com> wrote:
    > Out of curiousity, what do you suggest? Normalizing the relations and
    then
    > ignoring the functional dependencies by adding a separate numeric id
    field?
    > I can see how such works better with something like Cayenne, but it does
    > seem to run counter-intuitive to the model that was just designed
    > (especially with "static" information, such as an SSN).

    I'm probably misunderstanding something, but if you're suggesting that using
    a SSN can be a good idea because it won't change, you're probably being
    short-sighted.

    What happens when you find out a month later that someone typed the SSN in
    wrong? Now you've got references to the wrong SSN all over your database?
    Time to go in manually and edit everything......

    A meaningless primary key never needs to change because it doesn't represent
    anything. It's the only thing guaranteed to never change. No other piece
    of data can make that claim. If nothing else, data entry errors could cause
    a seemingly-constant value to change.

    -Mike



    This archive was generated by hypermail 2.0.0 : Thu Mar 10 2005 - 10:14:36 EST