• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fetch vs Qualifier on a Relationship Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch vs Qualifier on a Relationship Array


  • Subject: Re: Fetch vs Qualifier on a Relationship Array
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 4 Nov 2004 15:58:18 -0800

Faulting should happen automatically. What you are doing works for me. You are sure that the the PortfolioGroup and Portfolio are in the same editing context when doing the in memory filtering.

Chuck

P.S. Stylistically I am compelled so suggest:
EOQualifier portfolioQualifier = EOQualifier.qualifierWithQualifierFormat("porfolio = %@", new NSArray(porfolio));


over
EOQualifier myQualifier2;
NSMutableArray args2 = new NSMutableArray();
args2.addObject("portfolio");
args2.addObject(portfolio);
myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);


Chuck


On Nov 4, 2004, at 2:41 PM, James Cicenia wrote:

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(portfolioUserGro ups(), 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:
village.net


This email sent to email@hidden

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects




_______________________________________________
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


  • Follow-Ups:
    • Re: Fetch vs Qualifier on a Relationship Array
      • From: James Cicenia <email@hidden>
References: 
 >Fetch vs Qualifier on a Relationship Array (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: Fetch vs Qualifier on a Relationship Array
  • Next by Date: Re: Fetch vs Qualifier on a Relationship Array
  • Previous by thread: Re: Fetch vs Qualifier on a Relationship Array
  • Next by thread: Re: Fetch vs Qualifier on a Relationship Array
  • Index(es):
    • Date
    • Thread