Hi !
I am sure this question has already been asked. But I looked in the
mailing list archives, in wiki books and in project wonder and could
not find any solution to a problem that should be... simple.
I have two entities Source and Dest with an optional many to many
relationship between them.
I want to fetch all the Source EOs that have no Dest EO in the many to
many relationship.
At first I tried :
String format = "(dests = nil)";
EOQualifier qual = EOQualifier.qualifierWithQualifierFormat(format,
new NSArray(new Object[] { }));
EOFetchSpecification fs = new EOFetchSpecification("Source", qual,
null);
No luck.
And the funniest part is that if you fetch with
String format = "NOT (dests = nil)";
and if among 10 objects you have 6 that correspond, you still have 0
using "(dests = nil)"
I think I understand why but the behavior is suprising.
ERXToManyQualifier should be a solution looking at its Javadoc.
I tried the following :
NSArray<Dest> a;
ERXToManyQualifier qual = new ERXToManyQualifier("dests", a);
EOFetchSpecification fs = new EOFetchSpecification("Source", qual,
null);
I get a null pointer exception because a is null.
I tried
NSArray<Dest> a = NSArray.emptyArray;
Still no luck, I get a SQL error because there is no element in the
Array.
Is it THAT complicated to fetch an EO with an empty to-many
relationship ???
Best regards
Fabrice Pipart
www.easyshadow.com
EasyMediaOnline
Digital Signage Software
Easyshadow
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco
Skype: fabrice.pipart
Tel. +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07
_______________________________________________
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]