PATH |
EOKeyValueQualifier
Inherits from: EOQualifier
Implements: NSCoding EOKeyValueArchiving
Package: com.webobjects.eocontrol
Class Description
EOKeyValueQualifier is a subclass of EOQualifier that compares a named property of an object with a supplied value, for example, "salary > 1500". EOKeyValueQualifier implements the EOQualifierEvaluation interface, which defines the method evaluateWithObject for in-memory evaluation. When an EOKeyValueQualifier object receives an evaluateWithObject message, it evaluates the given object to determine if it satisfies the qualifier criteria.
In addition to performing in-memory filtering, EOKeyValueQualifier can be used to generate SQL. When it's used for this purpose, the key should be a valid property name of the root entity for the qualifier (or a valid key path).
Interfaces Implemented
EOQualifierEvaluation evaluateWithObject NSCoding classForCoder decodeObject encodeWithCoder EOKeyValueArchiving decodeWithKeyValueUnarchiver encodeWithKeyValueArchiver
Constructors
EOKeyValueQualifier
public EOKeyValueQualifier( String key, NSSelector selector, Object value)
If key, selector, and value are provided, the EOKeyValueQualifier compares values for key to value using the operator method selector. The possible values for selector are as follows:
- QualifierOperatorEqual
- QualifierOperatorNotEqual
- QualifierOperatorLessThan
- QualifierOperatorGreaterThan
- QualifierOperatorLessThanOrEqualTo
- QualifierOperatorGreaterThanOrEqualTo
- QualifierOperatorContains
- QualifierOperatorLike
- QualifierOperatorCaseInsensitiveLike
Enterprise Objects Framework supports SQL generation for these methods only. You can generate SQL using the EOSQLExpression static method sqlStringForKeyValueQualifier.
For example, the following excerpt creates an EOKeyValueQualifier qual
that has the key "name", the operator method QualifierOperatorEqual
, and the value "Smith". Once constructed, the qualifier qual
is used to filter an in-memory array.
NSArray employees /* Assume this exists */ EOKeyValueQualifier qual = new EOKeyValueQualifier("name", EOQualifier.QualifierOperatorEqual, "Smith"); return EOQualifier.filteredArrayWithQualifier(employees, qual);
Static Methods
decodeObject
public static Object decodeObject(NSCoder coder)
decodeWithKeyValueUnarchiver
public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
Instance Methods
addQualifierKeysToSet
public void addQualifierKeysToSet(NSMutableSet aSet)
classForCoder
public Class classForCoder()
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
encodeWithKeyValueArchiver
public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
evaluateWithObject
public boolean evaluateWithObject(NSKeyValueCodingAdditions anObject)
key
public String key()
qualifierWithBindings
public EOQualifier qualifierWithBindings( NSDictionary, boolean)
selector
public NSSelector selector()
toString
public String toString()
value
public Object value()
validateKeysWithRootClassDescription
public voidvalidateKeysWithRootClassDescription(EOClassDescription classDesc)
null
to indicate that the keys contained by the qualifier are valid.
© 2001 Apple Computer, Inc. (Last Published April 19, 2001)