• 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: Updating EOObjects/Selecting EOObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating EOObjects/Selecting EOObjects


  • Subject: Re: Updating EOObjects/Selecting EOObjects
  • From: Ken Anderson <email@hidden>
  • Date: Tue, 23 Aug 2005 08:50:39 -0400

It's also important to realize that you can construct qualifiers with relationships without having to go down into the attributes (which you shouldn't even be able to do because the relationship attributes should not be class properties!). For instance, if you wanted to find all the classes that a particular teacher teaches, assuming you have teacher objects and schoolClass objects, and your schoolClass EO has a relationship called 'teacher':

EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat ("teacher = %@", new NSArray(teacherObj));

EOF knows that 'teacher' is a relationship on schoolClass, so it will use the related properties and generate a query something like this:

select class_name, blah, blah from school_class t0 where t0.teacher_id = 42

Ken

On Aug 22, 2005, at 10:57 PM, LD wrote:

Hi there,

On 23/08/2005, at 11:29 AM, Jonathan Miller wrote:



I know understand addObjectToBothSides... and removeObject ...



:-)



but what would you use to construct a qualifier over a relationship when selecting objects?



EOQualifier will construct a qualifier based on the criteria you specify.
e.g.,
NSMutableArray args = new NSMutableArray();
args.addObject( "firstName" );
args.addObject( someObject.name() );
args.addObject( "lastName" );
args.addObject( filteredFamily.lastName() );
EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat("% s = %@ AND %s != %@", args);


Constructs:
------------- EOAndQualifier --------------
        |                          |
EOKeyValueQualifier        EOKeyValueQualifier

with regards,
--

LD



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com


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: Updating EOObjects/Selecting EOObjects
      • From: Arturo Perez <email@hidden>
References: 
 >Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Chuck Hill <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Chuck Hill <email@hidden>)
 >Re: Updating EOObjects (From: Arturo Pérez <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Arturo Pérez <email@hidden>)
 >Re: Updating EOObjects/Selecting EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects/Selecting EOObjects (From: LD <email@hidden>)

  • Prev by Date: Re: How to create a context on-the-fly
  • Next by Date: Re: EOModeler Problems
  • Previous by thread: Re: Updating EOObjects/Selecting EOObjects
  • Next by thread: Re: Updating EOObjects/Selecting EOObjects
  • Index(es):
    • Date
    • Thread