• 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: accessing the primarykey???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accessing the primarykey???


  • Subject: Re: accessing the primarykey???
  • From: Theodore Petrosky <email@hidden>
  • Date: Wed, 14 Jul 2010 05:53:50 -0700 (PDT)

What I wanted was a way to create a qualifier searching for a primaryKey... I am using the primaryKey as the jobNumber so what I ended up with is:

try {
	versionQual = Version.VERSION_STATUS.dot(VersionStatus.VERSION_STATUS_TITLE).eq("Billed").and(Version.JOB.eq( (Job) EOUtilities.objectWithPrimaryKeyValue(versionListEC, "Job", Integer.parseInt(jobNumberHolder()))));

	} catch (EOObjectNotAvailableException na){
		noSuchJobNumber = true;
		versionQual = Version.VERSION_STATUS.dot(VersionStatus.VERSION_STATUS_TITLE).eq("Billed");
	} catch (NumberFormatException nfe) {
		noSuchJobNumber = true;
		versionQual = Version.VERSION_STATUS.dot(VersionStatus.VERSION_STATUS_TITLE).eq("Billed");
	}

versionList = Version.fetchVersions(versionListEC, versionQual, null);
theVersionListDG.setObjectArray(versionList);
return null;

where I get the primaryKey from jobNumberHolder()....

it works great. I hope it is 'correct'.

Ted

--- On Tue, 7/13/10, Chuck Hill <email@hidden> wrote:

> From: Chuck Hill <email@hidden>
> Subject: Re: accessing the primarykey???
> To: "Lachlan Deck" <email@hidden>
> Cc: "Theodore Petrosky" <email@hidden>, "WebObjects-Dev Mailing List List" <email@hidden>
> Date: Tuesday, July 13, 2010, 11:05 PM
>
> On Jul 13, 2010, at 7:30 PM, Lachlan Deck wrote:
>
> > If you need to append to that qualifier (e.g.,
> isDeleted=false) you can also do:
> >
> > EOEntity eoEntity = EOUtilities.entityNamed(ec,
> Foo.ENTITY_NAME);
> > String pkName =
> eoEntity.primaryKeyAttributeNames().objectAtIndex(0);
> > NSDictionary<String, Object> pk = new
> NSDictionary<String, Object>(Long.valueOf(pkString),
> pkName);
> > EOQualifier pkQualifier =
> eoEntity.qualifierForPrimaryKey(pk);
> > ...
>
> EOQualifier pkQualifier =  EOUtilities.
> qualifierForEnterpriseObject(eo.editingContext(), eo);
>




 _______________________________________________
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

  • Follow-Ups:
    • Re: accessing the primarykey???
      • From: Lachlan Deck <email@hidden>
References: 
 >Re: accessing the primarykey??? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Antw: Re: Prevent "Connection reset by peer" message to be shown in log file
  • Next by Date: Re: Failed to provide primary keys?
  • Previous by thread: Re: accessing the primarykey???
  • Next by thread: Re: accessing the primarykey???
  • Index(es):
    • Date
    • Thread