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:
- EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, IERXChainableQualifier, Serializable, Cloneable
- Direct Known Subclasses:
- ERXEOToManyQualifier
public class ERXToManyQualifier
- extends ERXKeyValueQualifier
- implements 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 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 |
| Methods inherited from class com.webobjects.eocontrol.EOQualifier |
_isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector |
MatchesAllInArraySelectorName
public static String MatchesAllInArraySelectorName
log
public static final Logger log
- logging support
ERXToManyQualifier
public ERXToManyQualifier(String toManyKey,
NSArray elements)
ERXToManyQualifier
public ERXToManyQualifier(String toManyKey,
NSArray elements,
int minCount)
elements
public NSArray elements()
key
public String key()
- Overrides:
key in class EOKeyValueQualifier
minCount
public int minCount()
toString
public String toString()
- Description of the qualfier.
- Overrides:
toString in class EOKeyValueQualifier
- Returns:
- description of the key and which elements it
should contain.
clone
public Object clone()
- Implementation of the Cloneable interface.
- Overrides:
clone in class EOQualifier
- Returns:
- clone of the qualifier.
qualifierWithBindings
public EOQualifier qualifierWithBindings(NSDictionary arg0,
boolean arg1)
- Overrides:
qualifierWithBindings in class EOKeyValueQualifier
validateKeysWithRootClassDescription
public void validateKeysWithRootClassDescription(EOClassDescription arg0)
- Overrides:
validateKeysWithRootClassDescription in class EOKeyValueQualifier
addQualifierKeysToSet
public void addQualifierKeysToSet(NSMutableSet arg0)
- Overrides:
addQualifierKeysToSet in class EOKeyValueQualifier
evaluateWithObject
public boolean evaluateWithObject(Object object)
- Specified by:
evaluateWithObject in interface EOQualifierEvaluation- Overrides:
evaluateWithObject in class EOKeyValueQualifier
Copyright © 2002 – 2007 Project Wonder.