• 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: Jean-François Veillette <email@hidden>
  • Date: Thu, 4 Nov 2004 18:53:56 -0500

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(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:
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
  • 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: WO & Lucene
  • Next by Date: Re: Fetch vs Qualifier on a Relationship Array
  • Previous by thread: Fetch vs Qualifier on a Relationship Array
  • Next by thread: Re: Fetch vs Qualifier on a Relationship Array
  • Index(es):
    • Date
    • Thread