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 protected]> wrote:

> From: Chuck Hill <[email protected]>
> Subject: Re: accessing the primarykey???
> To: "Lachlan Deck" <[email protected]>
> Cc: "Theodore Petrosky" <[email protected]>, "WebObjects-Dev Mailing List 
> List" <[email protected]>
> 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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to