Daniel,
I should have asked, but you’re using WOnder, right? I use WOnder and templates that generate a lot of good stuff. Are you generating _<Entity> and <Entity> files?
Assuming you are, you can use some of the convenience methods, like:
NSArray<Car> = Car.fetchCars(editingContext, Car.BRAND.in(brands), null);
You can do all of this without the templates, but you really need ERXKEY to generate the qualifier for you.
Ken
On Feb 12, 2015, at 11:15 AM, Daniel Hausberger < email@hidden> wrote:
Hi Ken,
thank you for your reply. This looks exactly like the thing i have looked for, but i have no idea how to use this?
How do i get a list of Cars with the ERXOrQualifier? Sorry for this question, but i have never done it like this before.
Can you help me?
Thanks,
Daniel
Gesendet: Donnerstag, 12. Februar 2015 um 17:06 Uhr
Von: "Ken Anderson" < email@hidden>
An: "Daniel Hausberger" < email@hidden>
Cc: email@hidden
Betreff: Re: EOModeler, search with Array
Daniel,
You can use the in method of the ERXKEY like this:
NSArray<Brand> brands = new NSArray<Brand>(new Brand[] {vw, audi, bmw});
Car.BRAND.in(brands);
This still generates an OR qualifier, but it’s prettier.
Ken
On Feb 12, 2015, at 8:25 AM, Daniel Hausberger < email@hidden> wrote:
Hi Experts,
i'm strugeling around with an (i think so) easy problem: What is the right way to make an Qualifier (for a Fetch-Specification in EOModeler) to not search with just one single Object, but with a list of objects:
For example this model:
1 Car-Brand produces many Cars (e.g. VW procudes Jetta, Golf, Passat, etc.)
If i want to search all Cars for "VW" my qualifier looks something like:
brand = $carBrand ... (eg. Car.fetchForList(ec, brandVW);)
But was is the correct way to search for a list of brands? e.g: What is the correct way to search for all Cars of "VW", "Audi", etc.?
I know that it is possible to search something like this:
brand = $carBrand1 or brand = $carBrand2, etc. (e.g. Car.fetchForList(ec, brandVW, brandAudi, etc.);).
But this is not the best way?
Thank you,
Daniel
_______________________________________________
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
|