er.extensions.eof.qualifiers
Class ERXToManyQualifier
java.lang.Object
com.webobjects.eocontrol.EOQualifier
com.webobjects.eocontrol.EOKeyValueQualifier
er.extensions.qualifiers.ERXKeyValueQualifier
er.extensions.eof.qualifiers.ERXToManyQualifier
- All Implemented Interfaces:
- com.webobjects.eocontrol.EOKeyValueArchiving, com.webobjects.eocontrol.EOQualifierEvaluation, com.webobjects.foundation.NSCoding, IERXChainableQualifier, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- ERXEOToManyQualifier
public class ERXToManyQualifier
- extends ERXKeyValueQualifier
- implements java.lang.Cloneable
Optimized toMany qualifier, much, much better SQL than the Apple provided qualifier.
Really nice when you want to find all the eos that have say five of the
ten eos in their toMany relationship. This qualifier will always only
generate three joins no matter how many eos you are trying to find. Example usage:
NSArray employees; // given, can be null
// Find all of the departments that have all of those employees
ERXToManyQualifier q = new ERXToManyQualifier("toEmployees", employees);
EOFetchSpecification fs = new EOFetchSpecification("Department", q, null);
NSArray departments = ec.objectsWithFetchSpecification(fs);
If you want to find say departments that have 5 or more of the given
employees (imagine you have a list of 10 or so), then you could
construct the qualifier like:
ERXToManyQualifier q = new ERXToManyQualifier("toEmployees", employees, 5);
or to find any department that has at least one of the given employees
ERXToManyQualifier q = new ERXToManyQualifier("toEmployees", employees, 1);
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOQualifier |
com.webobjects.eocontrol.EOQualifier.Comparison, com.webobjects.eocontrol.EOQualifier.ComparisonSupport, com.webobjects.eocontrol.EOQualifier.QualifierVariableSubstitutionException |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding |
com.webobjects.foundation.NSCoding._BigDecimalSupport, com.webobjects.foundation.NSCoding._BigIntegerSupport, com.webobjects.foundation.NSCoding._BooleanSupport, com.webobjects.foundation.NSCoding._ByteSupport, com.webobjects.foundation.NSCoding._CharacterSupport, com.webobjects.foundation.NSCoding._DateSupport, com.webobjects.foundation.NSCoding._DoubleSupport, com.webobjects.foundation.NSCoding._FloatSupport, com.webobjects.foundation.NSCoding._IntegerSupport, com.webobjects.foundation.NSCoding._LongSupport, com.webobjects.foundation.NSCoding._NumberSupport, com.webobjects.foundation.NSCoding._ShortSupport, com.webobjects.foundation.NSCoding._StringSupport, com.webobjects.foundation.NSCoding.Support |
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving |
com.webobjects.eocontrol.EOKeyValueArchiving._NullValueSupport, com.webobjects.eocontrol.EOKeyValueArchiving._NumberSupport, com.webobjects.eocontrol.EOKeyValueArchiving._TimestampSupport, com.webobjects.eocontrol.EOKeyValueArchiving.Awaking, com.webobjects.eocontrol.EOKeyValueArchiving.FinishInitialization, com.webobjects.eocontrol.EOKeyValueArchiving.Support |
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 |
ERXToManyQualifier(java.lang.String toManyKey,
com.webobjects.foundation.NSArray elements)
|
ERXToManyQualifier(java.lang.String toManyKey,
com.webobjects.foundation.NSArray elements,
int minCount)
|
Methods inherited from class com.webobjects.eocontrol.EOKeyValueQualifier |
_accept, classForCoder, decodeObject, decodeWithKeyValueUnarchiver, encodeWithCoder, encodeWithKeyValueArchiver, equals, selector, 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 |
MatchesAllInArraySelectorName
public static final java.lang.String MatchesAllInArraySelectorName
- See Also:
- Constant Field Values
log
public static final org.apache.log4j.Logger log
- logging support
ERXToManyQualifier
public ERXToManyQualifier(java.lang.String toManyKey,
com.webobjects.foundation.NSArray elements)
ERXToManyQualifier
public ERXToManyQualifier(java.lang.String toManyKey,
com.webobjects.foundation.NSArray elements,
int minCount)
elements
public com.webobjects.foundation.NSArray elements()
key
public java.lang.String key()
- Overrides:
key
in class com.webobjects.eocontrol.EOKeyValueQualifier
minCount
public int minCount()
toString
public java.lang.String toString()
- Description of the qualfier.
- Overrides:
toString
in class com.webobjects.eocontrol.EOKeyValueQualifier
- Returns:
- description of the key and which elements it
should contain.
clone
public java.lang.Object clone()
- Implementation of the Cloneable interface.
- Overrides:
clone
in class com.webobjects.eocontrol.EOQualifier
- Returns:
- clone of the qualifier.
qualifierWithBindings
public com.webobjects.eocontrol.EOQualifier qualifierWithBindings(com.webobjects.foundation.NSDictionary arg0,
boolean arg1)
- Overrides:
qualifierWithBindings
in class com.webobjects.eocontrol.EOKeyValueQualifier
validateKeysWithRootClassDescription
public void validateKeysWithRootClassDescription(com.webobjects.eocontrol.EOClassDescription arg0)
- Overrides:
validateKeysWithRootClassDescription
in class com.webobjects.eocontrol.EOKeyValueQualifier
addQualifierKeysToSet
public void addQualifierKeysToSet(com.webobjects.foundation.NSMutableSet arg0)
- Overrides:
addQualifierKeysToSet
in class com.webobjects.eocontrol.EOKeyValueQualifier
evaluateWithObject
public boolean evaluateWithObject(java.lang.Object object)
- Specified by:
evaluateWithObject
in interface com.webobjects.eocontrol.EOQualifierEvaluation
- Overrides:
evaluateWithObject
in class com.webobjects.eocontrol.EOKeyValueQualifier
Copyright © 2002 – 2007 Project Wonder.