Re: Fetch vs Qualifier on a Relationship Array
Re: Fetch vs Qualifier on a Relationship Array
- Subject: Re: Fetch vs Qualifier on a Relationship Array
- From: James Cicenia <email@hidden>
- Date: Thu, 4 Nov 2004 18:17:22 -0600
Yes - I actually have looping code like you in some of my earlier
attempts, or should I say failures to get a deep relationship
qualifier to work.
The fetch works so that is good enough for now.
-James
On Nov 4, 2004, at 5:53 PM, Jean-François Veillette wrote:
In memory qualifier on to-many relationship doesn't use the same logic
as most (if not all) db's.
Search the archive, i've seen a work-around kind of solution posted.
In my last project I had that exact same problem, I endend up doing my
qualifier manually, in a loop over the eo's. You may not have that
luxury.
good luck !
- jfv
Le 04-11-04, à 17:41, James Cicenia a écrit :
Hello -
Why is it when I do a qualifier on a related array I get nothing back
but when I do a fetch I get the correct
result?
This works:
EOQualifier myQualifier1;
NSMutableArray args1 = new NSMutableArray();
args1.addObject("user");
args1.addObject(this);
myQualifier1 = EOQualifier.qualifierWithQualifierFormat("%@ = %@",
args1);
EOQualifier myQualifier2;
NSMutableArray args2 = new NSMutableArray();
args2.addObject("portfolio");
args2.addObject(portfolio);
myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@",
args2);
EOAndQualifier andQualifier1 = new EOAndQualifier(new NSArray(new
Object[]{myQualifier1,myQualifier2}));
EOFetchSpecification fs = new
EOFetchSpecification("PortfolioUserGroup",andQualifier1,null);
NSMutableArray results = (NSMutableArray)
this.editingContext().objectsWithFetchSpecification(fs);
While this won't. Why?
Object nameOrdering = null;
EOQualifier myQualifier;
NSMutableArray args = new NSMutableArray();
args.addObject("portfolio");
args.addObject(portfolio);
myQualifier = EOQualifier.qualifierWithQualifierFormat("%@ = %@",
args);
NSMutableArray results =
(NSMutableArray)EOQualifier.filteredArrayWithQualifier(portfolioUserGr
oups(), myQualifier);
the porftfolioUserGroups() is a relation that points portfolios to
users to groups. The original array it returns is correct but when
I qualify it with the portfolio it returns nothing. I have checked
that the portfolio is correct and the array is correct. I am guessing
it has to do with faulting. Is there some deep fault switch I am
missing?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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