• 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: Alexander Spohr <email@hidden>
  • Date: Sat, 23 Apr 2011 00:07:19 +0200

Am 22.04.2011 um 22:59 schrieb Chris Pastore:

> 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 fetch the student into the ctx. So it is already existent in the database and not a new one that you could insert.
You only insert newly created objects. So that they will be saved to the database.

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

You don’t show where you get value.

> The value of globalID is always null. What am I missing?

Maybe value is null?

	atze

 _______________________________________________
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: Re: EOGlobalID
  • Next by Date: Re: EOGlobalID
  • Previous by thread: Re: EOGlobalID
  • Next by thread: Re: EOGlobalID
  • Index(es):
    • Date
    • Thread