Project Wonder 5.0

er.extensions.eof.qualifiers
Class ERXToManyQualifier

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.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 Class Summary
static class ERXToManyQualifier.ToManyQualifierSQLGenerationSupport
          Adds SQL generation support.
 
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
 
Field Summary
static org.apache.log4j.Logger log
          logging support
static java.lang.String MatchesAllInArraySelectorName
           
 
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)
           
 
Method Summary
 void addQualifierKeysToSet(com.webobjects.foundation.NSMutableSet arg0)
           
 java.lang.Object clone()
          Implementation of the Cloneable interface.
 com.webobjects.foundation.NSArray elements()
           
 boolean evaluateWithObject(java.lang.Object object)
           
 java.lang.String key()
           
 int minCount()
           
 com.webobjects.eocontrol.EOQualifier qualifierWithBindings(com.webobjects.foundation.NSDictionary arg0, boolean arg1)
           
 java.lang.String toString()
          Description of the qualfier.
 void validateKeysWithRootClassDescription(com.webobjects.eocontrol.EOClassDescription arg0)
           
 
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, 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
 

Field Detail

MatchesAllInArraySelectorName

public static final java.lang.String MatchesAllInArraySelectorName
See Also:
Constant Field Values

log

public static final org.apache.log4j.Logger log
logging support

Constructor Detail

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)
Method Detail

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

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.