Re: Struggling with qualifiers involving sets
Re: Struggling with qualifiers involving sets
- Subject: Re: Struggling with qualifiers involving sets
- From: Denis Stanton <email@hidden>
- Date: Mon, 4 Aug 2003 11:30:54 +1200
Hi George
Thank you so much. That's just what I needed. I had the simpler parts
of the code you supplied below, but my enumerator was building an array
of type values, rather than an array of qualifiers using type values.
I didn't understand that I should put a whole bunch of qualifiers into
an array and then group them into a new EOOrQualifier(qualifiersToOr).
After finding the four typos you put in there to see if I was watching
( :-) ) the code is doing what I imagined it doing about three days
ago. Onwards!
Thank you for taking the time to put me right.
Denis
On Monday, August 4, 2003, at 09:40 AM, George Domurot wrote:
You should take a peak at the EOQualifer and EOOrQualifier
documentation. Give this a whirl (not tested)...
NSMutableArray qualifiersToOr = new NSMutableArray();
Enumeration e = typsSelectionSet.objectEnumeratior();
while (e.hasMoreElements())
qualifiersToOr.addObject(EOQualifier.qualifierWithQualifierFormant("typ
e = %Q", new NSArray(e.nextElement()));
EOFetchSpecification fetchSpec = new EOFetchSpecification("Vehicle",
new EOOrQualifier(qualifiersToOr), null);
NSMutableArray(editingContext.objectsWithFetchSpecification(fetchSpec))
;
On Sunday, August 3, 2003, at 04:24 AM, Denis Stanton wrote:
I'm having trouble understanding how to construct a qualifier to use
in an EOFetchSpecification
I want to read a table of Vehicles and select all those that have
Types matching a list that the user has selected.
Each Vehicle has a one-to-one relationship to a Type, so if I was
looking for all vehicles of a single type instance named requiredType
I could write:
NSMutableArray args = new NSMutableArray();
args.addObject(requiredType);
qualifier = EOQualifier.qualifierWithQualifierFormat("type =
%@", args);
fetchSpec = new EOFetchSpecification("Vehicle", qualifier,
null);
NSMutableArray vehicleArray = new
NSMutableArray(editingContext.objectsWithFetchSpecification(fetchSpec)
);
What I can't figure out is how to expand this to the case where there
are multiple types but the number selected may vary.
my selected Types are in a set
NSMutableSet typeSelectionSet;
How can I use this set in my fetch spec? I have read the EOQualifier
specification, but I'm confused. The examples given don't seem to
cover my situation. Any suggestions?
Denis
_______________________________________________
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.
Denis Stanton
email@hidden
Home: (09) 533 0391
mobile: 021 1433622
_______________________________________________
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.