Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOControl Reference

Table of Contents

EONotQualifier


Inherits from:
EOQualifier : NSObject
Conforms to:
EOQualifierEvaluation
EOQualifierSQLGeneration
Declared in:
EOControl/EOQualifier.h




Class Description


EONotQualifier is a subclass of EOQualifier that contains a single qualifier. When an EONotQualifier object is evaluated, it returns the inverse of the result obtained by evaluating the qualifier it contains.

EONotQualifier adopts the EOQualifierEvaluation protocol, which defines the method evaluateWithObject: for in-memory evaluation. When an EONotQualifier object receives an evaluateWithObject: message, it evaluates the given object to determine if it satisfies the qualifier criteria.

You can generate SQL code for an EONotQualifier using the EOSQLExpression static method sqlStringForNegatedQualifier.




Adopted Protocols


EOQualifierEvaluation
- evaluateWithObject:
EOQualifierSQLGeneration
- sqlStringForSQLExpression:
- schemaBasedQualifierWithRootEntity:


Instance Methods



evaluateWithObject:

- (BOOL)evaluateWithObject:anObject

Returns YES if the object anObject satisfies the EONotQualifier, NO otherwise. This method can raise one of several possible exceptions if an error occurs. If your application allows users to construct arbitrary qualifiers (such as through a user interface), you may want to put exception handlers around this method to properly respond to errors (for example, by displaying a panel saying that the user typed a poorly formed qualifier).

initWithQualifier:

- initWithQualifier:(EOQualifier *)aQualifier

Initializes the receiver with the EOQualifier aQualifier. For example, the following code excerpt constructs a qualifier, baseQual, and uses it to initialize an EONotQualifier, negQual. The EONotQualifier negQual is then used to filter an in-memory array. The code excerpt returns an array of Guest objects whose lastName properties do not have the same value as the lastName property of the guest's sponsoring member (this example is based on the Rentals sample database). In other words, the EONotQualifier negQual inverts the effects of baseQual.
NSArray *guests;     /* Assume this exists. */
EOQualifier *baseQual, *negQual;

baseQual = [EOQualifier qualifierWithQualifierFormat:@"lastName = member.lastName"];
negQual = [[EONotQualifier alloc] initWithQualifier:baseQual];
return [guests filteredArrayUsingQualifier:negQual];



qualifier

- (EOQualifier *)qualifier

Returns the receiver's qualifier.


Table of Contents