• 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: assigning primary key on insertion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: assigning primary key on insertion


  • Subject: Re: assigning primary key on insertion
  • From: Max Muller <email@hidden>
  • Date: Tue, 20 May 2003 13:11:41 -0700

Hi Jonathan,

On Tuesday, May 20, 2003, at 11:05 AM, Jonathan Rochkind wrote:

Thanks; looking at this code, it looks like it provides a way to generate pk in a custom way, but the _point_ of generation is unchanged. That is, pk is still generated/assigned upon saveChanges() of a new object.

I'm interested in generating the pk upon insertObject, when it's still uncommitted, but in fact still using the usual way of generating them... oh wait, now I see. You can call primaryKeyDictionary(false) to have the EO generate a pk in advance, and then the db context delegate will use that pk when it's finally committed. Interesting. This won't change the EOGlobalID for the object though, right? The EO will still have a temporary globalID until it is committed, even though the EO itself 'knows' it's eventual permanent pks. Am I following? Thanks.

Yes same EOGlobalId is used (EOTemporaryGlobalID pre-commit, EOKeyGlobalID post-commit).


Regards,
	Max

At 01:13 AM 5/20/2003 -0700, you wrote:
Hi Jonathan,
There is an example of this in the Project Wonder codebase. ERXDatabaseContextDelegate, ERXGeneratesPrimaryKeyInterface and ERXGenericRecord (for an example of the implementation).


Regards,
        Max

On Monday, May 19, 2003, at 12:33 PM, Jonathan Rochkind wrote:

Nevermind! I just found it. I'll put the info on www.wodev.com, if anyone else is interested.

At 01:49 PM 5/19/2003 -0500, you wrote:
A little while ago, I was having a discussion with someone on the list about how to assign a pk to an EO as soon as it's inserted in the EC, rather than waiting for it to be saved. They had a method which did not require making the pk attribute class-visible, and which used the same pk-generation technique which EOF would use on saveChanges(), but somehow triggered it upon insertObject instead.

Except now I forget how they did this, and who it was that told me how to do it! But I'd like to do it. Anyone have any advice? [Whether or not you are the person I was originally talking to!]

--Jonathan
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: <http://www.lists.apple.com/mailman/listinfo/webobjects-dev>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>http:// www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
</blockquote></x-html>
_______________________________________________
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.

  • Prev by Date: Re: assigning primary key on insertion
  • Next by Date: Re: assigning primary key on insertion
  • Previous by thread: Re: assigning primary key on insertion
  • Next by thread: Re: assigning primary key on insertion
  • Index(es):
    • Date
    • Thread