Re: EOF and meaningful, modifiable PKs
Re: EOF and meaningful, modifiable PKs
- Subject: Re: EOF and meaningful, modifiable PKs
- From: Farrukh Ijaz <email@hidden>
- Date: Tue, 13 Jul 2010 14:19:39 +0300
On 2010-07-13, at 1:36 PM, Hugi Thordarson wrote:
> Good morning all.
>
> I have a large-ish database with meaningful, user modifiable PKs - which sucks. For legacy reasons, I can't ditch the old PKs entirely in favor of new ones - which also sucks. 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.
>
> 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?
Add another column called Magic column besides PK column. Copy the values from PK column to Magic column. Generate the Model using EOF. For front-end, give the user ability to modify Magic column value and add validation for uniqueness.
Farrukh
>
> 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.
>
> Cheers,
> - hugi _______________________________________________
> 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
_______________________________________________
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