Re: Non-integer primary keys
Re: Non-integer primary keys
- Subject: Re: Non-integer primary keys
- From: Art Isbell <email@hidden>
- Date: Mon, 2 Aug 2004 09:23:05 -1000
On Aug 2, 2004, at 12:01 AM, Steve Sharman wrote:
I'd like in the future to be able to implement a mechanism where I can
be absolutely sure that my primary keys are completely unique across
all instances of an application, even if those applications are
running on completely different database and application servers.
I must not be understanding your needs. Primary key values are unique
within a table in a database. The database guarantees uniqueness.
They have nothing to do with application instances or where the app or
database are running. All instances of an EO within different editing
contexts and in different app instances will have the same primary key
value, that which was fetched from the database. This must remain true
for EO caching to work correctly and for the correct mapping of an EO
to a database row.
I've seen a few references on the list to character primary keys, but
nothing much which is specific on implementation. Is there anywhere on
the web or in the development documentation that shows how this might
be done - presumably it's easy to set up the primary key for an EO as
being of character type, it's the PK generation mechanism that I'd
like to properly understand.
http://developer.apple.com/documentation/WebObjects/
Enterprise_Objects/Saving/chapter_8_section_5.html#//apple_ref/doc/uid/
TP30001011-DontLinkChapterID_14-TPXREF151 discusses the EOF hooks that
support custom primary key generation. But how to generate unique
primary key values is up to you.
Aloha,
Art
_______________________________________________
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.