Project Wonder 2.0

er.extensions
Class ERXToManyQualifier

java.lang.Object
  extended bycom.webobjects.eocontrol.EOQualifier
      extended byer.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

Nested Class Summary
static class ERXToManyQualifier.ToManyQualifierSQLGenerationSupport
          Adds SQL generation support.
 
Nested classes inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
 
Field Summary
static ERXLogger log
          logging support
 
Fields inherited from class com.webobjects.eocontrol.EOQualifier
_CLASS, QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
 
Constructor Summary
ERXToManyQualifier(String toManyKey, NSArray elements)
           
ERXToManyQualifier(String toManyKey, NSArray elements, int minCount)
           
 
Method Summary
 void addQualifierKeysToSet(NSMutableSet arg0)
           
 Object clone()
          Implementation of the Cloneable interface.
 NSArray elements()
           
 String key()
           
 int minCount()
           
 EOQualifier qualifierWithBindings(NSDictionary arg0, boolean arg1)
           
 String toString()
          Description of the qualfier.
 void validateKeysWithRootClassDescription(EOClassDescription arg0)
           
 
Methods inherited from class com.webobjects.eocontrol.EOQualifier
_accept, _isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, evaluateWithObject, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support

Constructor Detail

ERXToManyQualifier

public ERXToManyQualifier(String toManyKey,
                          NSArray elements)

ERXToManyQualifier

public ERXToManyQualifier(String toManyKey,
                          NSArray elements,
                          int minCount)
Method Detail

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)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.