er.extensions
Class ERXToManyQualifier
java.lang.Object
com.webobjects.eocontrol.EOQualifier
er.extensions.ERXToManyQualifier
- All Implemented Interfaces:
- Cloneable, EOQualifierEvaluation, Serializable
- Direct Known Subclasses:
- ERXEOToManyQualifier
- public class ERXToManyQualifier
- extends EOQualifier
- 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
// 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
Methods inherited from class com.webobjects.eocontrol.EOQualifier |
_accept, _isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, evaluateWithObject, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector |
log
public static final ERXLogger 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()
minCount
public int minCount()
toString
public String toString()
- Description of the qualfier.
- Returns:
- description of the key and which elements it
should contain.
clone
public Object clone()
- Implementation of the Cloneable interface.
- Returns:
- clone of the qualifier.
qualifierWithBindings
public EOQualifier qualifierWithBindings(NSDictionary arg0,
boolean arg1)
validateKeysWithRootClassDescription
public void validateKeysWithRootClassDescription(EOClassDescription arg0)
addQualifierKeysToSet
public void addQualifierKeysToSet(NSMutableSet arg0)
Copyright © 2002 – 2004 Project Wonder.