ERXInQualifier Class Reference

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

Inherited by ERXPrimaryKeyListQualifier.

Collaboration diagram for ERXInQualifier:

Collaboration graph
[legend]

List of all members.

Classes

class  InQualifierSQLGenerationSupport

Public Member Functions

Class classForCoder ()
Object clone ()
void encodeWithCoder (NSCoder coder)
void encodeWithKeyValueArchiver (EOKeyValueArchiver archiver)
 ERXInQualifier (String key, NSArray values, final int padToSize)
 ERXInQualifier (String key, NSArray values)
boolean evaluateWithObject (Object object)
String toString ()
NSArray values ()

Static Public Member Functions

static Object decodeObject (NSCoder coder)
static Object decodeWithKeyValueUnarchiver (EOKeyValueUnarchiver unarchiver)

Static Package Functions

 [static initializer]

Static Private Member Functions

static NSArray paddedValues (NSArray values, final int padToSize)

Static Private Attributes

static final int DefaultPadToSize


Detailed Description

The ERXInQualifier is useful for creating qualifiers that will generate SQL using the 'IN' key word.

For example constructing this qualifer:
ERXInQualifier q = new ERXInQualifier("userId", arrayOfNumbers); Then this qualifier would generate SQL of the form: USER_ID IN (<array of numbers or data>)

Constructor & Destructor Documentation

ERXInQualifier ( String  key,
NSArray  values 
)

Constructs an in qualifer for a given attribute name and an array of values.

Parameters:
key attribute name
values array of values

ERXInQualifier ( String  key,
NSArray  values,
final int  padToSize 
)

Constructs an in qualifer for a given attribute name and an array of values.

Parameters:
key attribute name
values array of values
padToSize the size which is expected to be reasonable for this qualifier. If the NSArray values has more than one element, the padToSize is used to round up the number of elements and pad with nulls. Doing this reduces the number of unique queries which result from having an arbitrary number of values. For example, if the padToSize is 8, then we'll either have 1, or 8, or 16, or... bind variables as compared to 1..., 2..., 3..., 4..., or ....16


Member Function Documentation

[static initializer] (  )  [static, package]

register SQL generation support for the qualifier

Reimplemented in ERXPrimaryKeyListQualifier.

Class classForCoder (  ) 

Object clone (  ) 

Reimplemented in ERXPrimaryKeyListQualifier.

static Object decodeObject ( NSCoder  coder  )  [static]

static Object decodeWithKeyValueUnarchiver ( EOKeyValueUnarchiver  unarchiver  )  [static]

void encodeWithCoder ( NSCoder  coder  ) 

void encodeWithKeyValueArchiver ( EOKeyValueArchiver  archiver  ) 

boolean evaluateWithObject ( Object  object  ) 

Tests if the given object's key is in the supplied values

static NSArray paddedValues ( NSArray  values,
final int  padToSize 
) [static, private]

Parameters:
values see ERXInQualifier
padToSize see ERXInQualifier
Returns:
an NSArray with a count that is an even multiple of padToSize and padded with the last element of the values array.

String toString (  ) 

String representation of the in qualifier.

Returns:
string description of the qualifier

NSArray values (  ) 


Member Data Documentation

final int DefaultPadToSize [static, private]

Initial value:

            ERXProperties.intForKeyWithDefault("er.extensions.ERXInQualifier.DefaultPadToSize", 8)


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

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