ERXPrimaryKeyListQualifier Class Reference

Inherits er::extensions::eof::qualifiers::ERXInQualifier.

Collaboration diagram for ERXPrimaryKeyListQualifier:

Collaboration graph
[legend]

List of all members.

Classes

class  Support

Public Member Functions

Object clone ()
 ERXPrimaryKeyListQualifier (String key, String foreignKey, NSArray eos)
 ERXPrimaryKeyListQualifier (String key, NSArray eos)
 ERXPrimaryKeyListQualifier (NSArray eos)

Static Public Attributes

static final String IsContainedInArraySelectorName = "isContainedInArray"

Static Protected Member Functions

static String primaryKeyNameForObjects (NSArray eos)
static NSArray validateObjects (NSArray eos)

Static Protected Attributes

static final Logger log = Logger.getLogger(ERXPrimaryKeyListQualifier.class)

Static Package Functions

 [static initializer]

Private Member Functions

 ERXPrimaryKeyListQualifier (String key, NSArray eos, boolean ignoreMe)


Detailed Description

The primary key list qualifier is used to generate a qualifier that can be used to filter a result set for a given set of primary keys. Note that this uses the IN expression and as such may not work with some databases.

Given a list of EOs, this generates a query looking like

... t0.ID in (< the list of primary Keys for EOs in the list>) ..

this is useful for pre-fetching type uses.


Constructor & Destructor Documentation

ERXPrimaryKeyListQualifier ( NSArray  eos  ) 

Constructs a primary key list qualifer for a given set of enterprise objects. For now only use this qualifier if the primary key attribute of your enterprise object is named 'id'.

Parameters:
eos array of enterprise objects

ERXPrimaryKeyListQualifier ( String  key,
NSArray  eos,
boolean  ignoreMe 
) [private]

ERXPrimaryKeyListQualifier ( String  key,
NSArray  eos 
)

Constructs a primary key list qualifer for a given set of enterprise objects and the primary key attribute name.

Parameters:
key primary key attribute name
eos array of enterprise objects

ERXPrimaryKeyListQualifier ( String  key,
String  foreignKey,
NSArray  eos 
)

Constructs a primary key list qualifer for a given set of enterprise objects, the primary key attribute name and a foreign key. This type of qualifier can be useful for prefetching a to-one relationship off of many enterprise objects.

Parameters:
key primary key attribute name
foreignKey attribute name.
eos array of enterprise objects


Member Function Documentation

[static initializer] (  )  [static, package]

register SQL generation support for the qualifier

Reimplemented from ERXInQualifier.

Object clone (  ) 

Reimplemented from ERXInQualifier.

static String primaryKeyNameForObjects ( NSArray  eos  )  [static, protected]

Calculates the primary key attribute name for an array of enterprise objects. This method assumes that all the entities of the objects have the same primary key attribute name.

Parameters:
eos array of enterprise objects
Returns:
primary key name for the enterprise objects in the array.

static NSArray validateObjects ( NSArray  eos  )  [static, protected]

Simple validation routine used to ensure that the objects being passed in are enterprise objects and have more than one in the array.

Parameters:
eos array of objects to check
Returns:
the array of objects if they pass the check.


Member Data Documentation

final String IsContainedInArraySelectorName = "isContainedInArray" [static]

final Logger log = Logger.getLogger(ERXPrimaryKeyListQualifier.class) [static, protected]

logging support


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