Project Wonder 5.0.0.8795

er.extensions.eof.qualifiers
Class ERXInQualifier

java.lang.Object
  extended by com.webobjects.eocontrol.EOQualifier
      extended by com.webobjects.eocontrol.EOKeyValueQualifier
          extended by er.extensions.qualifiers.ERXKeyValueQualifier
              extended by er.extensions.eof.qualifiers.ERXInQualifier
All Implemented Interfaces:
EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, IERXChainableQualifier, Serializable, Cloneable
Direct Known Subclasses:
ERXPrimaryKeyListQualifier

public class ERXInQualifier
extends ERXKeyValueQualifier
implements Cloneable

The ERXInQualifier is useful for creating qualifiers that will generate SQL using the 'IN' key word.

For example constructing this qualifer:
ERXInQualifier q = new ERXInQualifier("userId", arrayOfNumbers); Then this qualifier would generate SQL of the form: USER_ID IN (<array of numbers or data>)

See Also:
Serialized Form

Nested Class Summary
static class ERXInQualifier.InQualifierSQLGenerationSupport
          Adds SQL generation support.
 
Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
NSCoding._BigDecimalSupport, NSCoding._BigIntegerSupport, NSCoding._BooleanSupport, NSCoding._ByteSupport, NSCoding._CharacterSupport, NSCoding._DateSupport, NSCoding._DoubleSupport, NSCoding._FloatSupport, NSCoding._IntegerSupport, NSCoding._LongSupport, NSCoding._NumberSupport, NSCoding._ShortSupport, NSCoding._StringSupport, NSCoding.Support
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving._NullValueSupport, EOKeyValueArchiving._NumberSupport, EOKeyValueArchiving._TimestampSupport, EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOKeyValueQualifier
_CLASS, _key, _lowercaseCache, _selector, _value
 
Fields inherited from class com.webobjects.eocontrol.EOQualifier
QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
 
Constructor Summary
ERXInQualifier(String key, NSArray values)
          Constructs an in qualifer for a given attribute name and an array of values.
ERXInQualifier(String key, NSArray values, int padToSize)
          Constructs an in qualifer for a given attribute name and an array of values.
 
Method Summary
 Object clone()
           
 boolean evaluateWithObject(Object object)
          Tests if the given object's key is in the supplied values
 String toString()
          String representation of the in qualifier.
 NSArray values()
           
 
Methods inherited from class er.extensions.qualifiers.ERXKeyValueQualifier
and, filter, filtered, first, not, one, or, requiredOne
 
Methods inherited from class com.webobjects.eocontrol.EOKeyValueQualifier
_accept, addQualifierKeysToSet, classForCoder, decodeObject, decodeWithKeyValueUnarchiver, encodeWithCoder, encodeWithKeyValueArchiver, equals, key, qualifierWithBindings, selector, validateKeysWithRootClassDescription, value
 
Methods inherited from class com.webobjects.eocontrol.EOQualifier
_isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERXInQualifier

public ERXInQualifier(String key,
                      NSArray values)
Constructs an in qualifer for a given attribute name and an array of values.

Parameters:
key - attribute name
values - array of values

ERXInQualifier

public ERXInQualifier(String key,
                      NSArray values,
                      int padToSize)
Constructs an in qualifer for a given attribute name and an array of values.

Parameters:
key - attribute name
values - array of values
padToSize - the size which is expected to be reasonable for this qualifier. If the NSArray values has more than one element, the padToSize is used to round up the number of elements and pad with nulls. Doing this reduces the number of unique queries which result from having an arbitrary number of values. For example, if the padToSize is 8, then we'll either have 1, or 8, or 16, or... bind variables as compared to 1..., 2..., 3..., 4..., or ....16
Method Detail

toString

public String toString()
String representation of the in qualifier.

Overrides:
toString in class EOKeyValueQualifier
Returns:
string description of the qualifier

values

public NSArray values()

evaluateWithObject

public boolean evaluateWithObject(Object object)
Tests if the given object's key is in the supplied values

Specified by:
evaluateWithObject in interface EOQualifierEvaluation
Overrides:
evaluateWithObject in class EOKeyValueQualifier

clone

public Object clone()
Overrides:
clone in class EOQualifier

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.