Re: EOF and meaningful, modifiable PKs
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