• 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: SELECT objects with condition on all their relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: SELECT objects with condition on all their relationships


  • Subject: RE: SELECT objects with condition on all their relationships
  • From: <email@hidden>
  • Date: Mon, 9 May 2005 09:27:35 +0200
  • Thread-topic: SELECT objects with condition on all their relationships

Hi!
 
This would be a job for my ExistsInRelationshipQualifier. You would need to combine it with an EONotQualifier:
 
NOT (EXISTS employees WHERE data <> null)
 
The qualifier is available from my web page: http://homepage.mac.com/I_love_my
 
P.S: Currently the ExistsInRelationshipQualifier does not work as expected over flattened relationships
 
Pierre
-----Original Message-----
From: webobjects-dev-bounces+pierre.bernard=email@hidden [mailto:webobjects-dev-bounces+pierre.bernard=email@hidden]On Behalf Of DevReseune
Sent: Saturday, May 07, 2005 4:59 PM
To: Ken Anderson
Cc: webobjects-dev
Subject: Re: SELECT objects with condition on all their relationships

No, it's not my problem, but thanks for your response.

I want to find all Enterprises for which all Employees check a condition. If you create a qualifier condition like:
"employees.data = "">
you will find all Enterprises for which at least one Employee checks this condition. I don't know how to do for "all" objects of a relationship.

I hope that I was more comprehensible ;-)


Frédéric

Le 6 mai 05 à 20:56, Ken Anderson a écrit :

While your title suggests firing a relationship, you mention EOQualifiers in your text, so I'm not sure if you're attempting to get a subset of a relationship, or just do an open query.

If you want to get a subset of a relationship and the relationship results are not large (and will not grow to be large), you could always write a method on the object that would just iterate over the relationship and return the right group.  If the result set would normally be too large, I would suggest either changing the way the schema works, or creating a subentity of the target entity in a way that one sub-entity of the target entity would be the desired set.

As an example, if you have a relationship to an object that stores a complete history (like maybe customer->>orders), and you just want the open orders, you might consider subclassing order to have CompleteOrder and OpenOrder, qualifying the subclasses on open=TRUE or something like that.  In this way, you could have customer->>completeOrders and customer->>openOrders.

If you want to generate a query, you can just create an EOQualifier with the right condition, like:

EOQualifier.qualifierWithQualifierFormat("condition=%@", new NSArray(desiredCondition));

Does this answer your question?

Ken Anderson
President
Going Flying, Inc.


On May 6, 2005, at 12:36 PM, DevReseune wrote:


Hi,

I want to select all Enterprise objects that all their Employees check a condition. I don't know how to create an EOQualifier to do that. I know how to select enterprises that at least one employee checks the condition, but not all.

Thanks for your response.


Frédéric _______________________________________________
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




**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
 _______________________________________________
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

  • Prev by Date: DirectAction question
  • Next by Date: Is webobjects support rich UI controls?
  • Previous by thread: Re: SELECT objects with condition on all their relationships
  • Next by thread: Rendering a tree view in WO
  • Index(es):
    • Date
    • Thread