• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOF and meaningful, modifiable PKs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOF and meaningful, modifiable PKs


  • Subject: Re: EOF and meaningful, modifiable PKs
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 14 Jul 2010 10:32:49 -0700

On Jul 13, 2010, at 3:36 AM, Hugi Thordarson wrote:

> Good morning all.
>
> I have a large-ish database with meaningful, user modifiable PKs

User.  Modifiable.  PK.  WTF?!!?  Icelandic banking systems?  :-P


> - which sucks. For legacy reasons, I can't ditch the old PKs entirely in favor of new ones - which also sucks.

Are the users still going to be modifying them?  How did they handle that?  Update all the FKs in the same transaction?


> However, I need to write to this database using EOF, so I decided to throw this into the wild to see if someone  has dealt with something similar, or has some brilliant insight into the problem.

Run away?


> I believe I can solve this with brute force, for example:
>
> 1. Create new unique valued PK columns for each table in the DB. Make EOF use this for it's PK/globalID. Don't model any relationships, but create cover methods to manually fetch objects based on the "old" PKs and FKs, and mutators to maintain the fake-ish relationships.
>
> 2. Create new unique valued PK columns - AND new FK columns. Model relationships in EOF based on these. Create triggers in the DB to update the new FK columns when old FKs or PKs are modified, and vice versa.
>
> 3. Magic?
>
> If anyone has better ideas , I would *love* to hear it. I shudder at the thought of the amount of error-prone manual labour that will be involved in implementing either of the "solutions" mentioned above.


No magic is coming to mind.


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: EOF and meaningful, modifiable PKs
      • From: Hugi Thordarson <email@hidden>
References: 
 >EOF and meaningful, modifiable PKs (From: Hugi Thordarson <email@hidden>)

  • Prev by Date: Re: Failed to provide primary keys?
  • Next by Date: Re: ERModernLook and ERMODPickListPage
  • Previous by thread: Re: EOF and meaningful, modifiable PKs
  • Next by thread: Re: EOF and meaningful, modifiable PKs
  • Index(es):
    • Date
    • Thread