ERXToManyQualifier Class Reference

Inherits er::extensions::qualifiers::ERXKeyValueQualifier.

Inherited by ERXEOToManyQualifier.

Collaboration diagram for ERXToManyQualifier:

Collaboration graph
[legend]

List of all members.

Classes

class  ToManyQualifierSQLGenerationSupport

Public Member Functions

void addQualifierKeysToSet (NSMutableSet arg0)
Object clone ()
NSArray elements ()
 ERXToManyQualifier (String toManyKey, NSArray elements, int minCount)
 ERXToManyQualifier (String toManyKey, NSArray elements)
boolean evaluateWithObject (Object object)
String key ()
int minCount ()
EOQualifier qualifierWithBindings (NSDictionary arg0, boolean arg1)
String toString ()
void validateKeysWithRootClassDescription (EOClassDescription arg0)

Static Public Attributes

static final Logger log = Logger.getLogger(ERXToManyQualifier.class)
static final String MatchesAllInArraySelectorName = "matchesAllInArray"

Static Package Functions

 [static initializer]

Private Attributes

NSArray _elements
int _minCount = 0
String _toManyKey


Detailed Description

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);

Constructor & Destructor Documentation

ERXToManyQualifier ( String  toManyKey,
NSArray  elements 
)

ERXToManyQualifier ( String  toManyKey,
NSArray  elements,
int  minCount 
)


Member Function Documentation

[static initializer] (  )  [static, package]

register SQL generation support for the qualifier

void addQualifierKeysToSet ( NSMutableSet  arg0  ) 

Object clone (  ) 

Implementation of the Cloneable interface.

Returns:
clone of the qualifier.

NSArray elements (  ) 

boolean evaluateWithObject ( Object  object  ) 

String key (  ) 

int minCount (  ) 

EOQualifier qualifierWithBindings ( NSDictionary  arg0,
boolean  arg1 
)

String toString (  ) 

Description of the qualfier.

Returns:
description of the key and which elements it should contain.

void validateKeysWithRootClassDescription ( EOClassDescription  arg0  ) 


Member Data Documentation

NSArray _elements [private]

holds the array of elements

int _minCount = 0 [private]

holds the min count to match against, defaults to 0

String _toManyKey [private]

holds the to many key

final Logger log = Logger.getLogger(ERXToManyQualifier.class) [static]

logging support

final String MatchesAllInArraySelectorName = "matchesAllInArray" [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:12 2012 for Project Wonder by  doxygen 1.5.8