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

Re: EOGlobalID


  • Subject: Re: EOGlobalID
  • From: David LeBer <email@hidden>
  • Date: Fri, 22 Apr 2011 17:49:07 -0400

On 2011-04-22, at 4:59 PM, Chris Pastore wrote:

> While trying to return an EOGlobalID for a generic record, I am getting a null.
>
> I have a method to fetch a student:
> private static EOGenericRecord getStudent(EOEditingContext ctx, String sid) {
> 	EOGenericRecord student = (EOGenericRecord) EOUtilities.objectMatchingKeyAndValue(ctx, "Student", "studentId", sid);
> 	ctx.insertObject(student);  //tried with and without inserting it into the context

You don't ^^^ need to do that. If you fetch an eo into an ec, it is inserted by definition.

> 	return student;
> }
>
> Later I try to retrieve that object's EOGlobalID with the following:
> EOGlobalID globalID = ctx.globalIDForObject((EOGenericRecord) value);

Are you sure the eo is in the given ec? Safer would be: value.editingContext().globalIDForObject(value);

>
> The value of globalID is always null. What am I missing?
>
> Thank you for any help you may be able to offer,
>
> Chris Pastore

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 _______________________________________________
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

References: 
 >EOGlobalID (From: Chris Pastore <email@hidden>)

  • Prev by Date: EOGlobalID
  • Next by Date: Re: EOGlobalID
  • Previous by thread: EOGlobalID
  • Next by thread: Re: EOGlobalID
  • Index(es):
    • Date
    • Thread