• 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: Mixed PKs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Mixed PKs?
      • From: Giorgio Valoti <email@hidden>
References: 
 >Re: Mixed PKs? (From: Giorgio Valoti <email@hidden>)

  • Prev by Date: [Q] .api format?
  • Next by Date: Re: Changing from openbaseSql to MySql
  • Previous by thread: Re: Mixed PKs?
  • Next by thread: Re: Mixed PKs?
  • Index(es):
    • Date
    • Thread