Re: Mixed PKs?
Re: Mixed PKs?
- Subject: Re: Mixed PKs?
- From: Ricardo Strausz <email@hidden>
- Date: Wed, 2 Jul 2003 18:07:53 -0500
On miircoles, juli 2, 2003, at 07:41 America/Mexico_City, Giorgio
Valoti wrote:
On Lunedl, giu 30, 2003, at 15:26 US/Pacific, B. Shank wrote:
I assume you're referring to compound keys. If so, see
http://developer.apple.com/documentation/WebObjects/
Enterprise_Objects/Saving/chapter_8_section_8.html#//apple_ref/doc/
uid/DontLinkBookID_460-DontLinkChapterID_8-BADJEBIB
Brent
On Monday, June 30, 2003, at 2:16PM, Ricardo Strausz wrote:
Hola!
does EOF supports multiple PKs generation?
Let me be more specific: in a one-to-many relation (say
Invoices->>Details) I want to give Details a double PK; the invoices
PK and a consecutive number.
Can EOF (in its lateest version) do this for me?
Gracias,
EOF cannot generate compound primary keys, nor a RDBMS can for that
matter. Compound PK are usually composed by two or more foreign keys,
so they cannot be automatically generated. However, an auto-generated
primary key can be used for performance reasons, but some more
constraints should be enforced.
In your specific case, the Details PK is enough to uniquely identify a
record: adding the Invoice PK brings no advantages.
In fact, it does; this brings back an old discussion on the uses of
PKs. There are people who stiks in the paradigm of using "non-sense"
PKs, but in the database I am modeling, the PKs have meaning to the
users (invoice number, and item in the example below) so the object is
unique up to these constrains (e.g., the third item in the invoice
number 1234).
I suppose I will have to implement a databaseContextNewPrimaryKey
method in the DatabaseContext delegate.
Thanks any how,
Dino
HTH
--
Giorgio Valoti
-------------
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.