Re: Using compound primary keys with WebObjects?
Re: Using compound primary keys with WebObjects?
- Subject: Re: Using compound primary keys with WebObjects?
- From: Paul Lynch <email@hidden>
- Date: Mon, 17 Apr 2006 20:05:24 +0100
Compound primary keys work fine, so do custom generated ones. I use
both in several models (lots of compound ones, a few custom ones).
Using compound keys for join tables is "the WebObjects way", and
there shouldn't be any problems setting them up. Check the rules
about using key propagation, etc.
Custom keys are as well supported - the crux of the matter is that if
you hand over a valid primary key when the record is created, you
won't have any problems; so long as you have the key before
validation starts.
It is true that WO is over fond of its own primary key generation
mechanism, but it does make models generated for WO easy to use -
while still being able to do things the hard (legacy) way.
Paul
On 17 Apr 2006, at 18:51, peter Burnes wrote:
Hello,
Does anyone out there use compound primary keys in their EO model? I
know there are several ways to model persistence, but I am sort of
stuck with a database structure that cannot be changed (at the
moment). I have read/been told some WebObjects advice that we seem to
give dire warnings about not using the automated primary key
generation features of WebObjects on every table. There seems to be a
mantra that all tables need a single primary key, which is
automatically created and and that compound primary keys are evil...
well at least that was the gist :-)
While I do use automated primary key generation, I inherited a few
tables that are "join tables" where the primary keys are compounded.
It seems like from reading the Apple docs and even seeing the
propagate primary key option in EOModeler, that is there is support
for this concept.
I am just interested if there are those out there that have used
"propagate primary key"/compound keys or even custom-generated primary
keys in real-world WebObjects applications? I know I could try to
convince the DBA to redesign the data model, but at this point trying
to see if WebObjects can handle this legacy application or if I
proceed, with trying a WebObjects solution, that I will be heading for
pitfalls without using the "WebObjects way".
Pete
_______________________________________________
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