er.extensions.eof.qualifiers
Class ERXPrimaryKeyListQualifier
java.lang.Object
com.webobjects.eocontrol.EOQualifier
com.webobjects.eocontrol.EOKeyValueQualifier
er.extensions.qualifiers.ERXKeyValueQualifier
er.extensions.eof.qualifiers.ERXInQualifier
er.extensions.eof.qualifiers.ERXPrimaryKeyListQualifier
- All Implemented Interfaces:
- EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, IERXChainableQualifier, Serializable, Cloneable
public class ERXPrimaryKeyListQualifier
- extends ERXInQualifier
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.
- See Also:
- Serialized Form
|
Nested Class Summary |
static class |
ERXPrimaryKeyListQualifier.Support
Support class that listens for EOKeyValueQualifiers that have an isContainedInArray-selector and replaces these
with the ERXInQualifier. |
| Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding |
NSCoding._BigDecimalSupport, NSCoding._BigIntegerSupport, NSCoding._BooleanSupport, NSCoding._ByteSupport, NSCoding._CharacterSupport, NSCoding._DateSupport, NSCoding._DoubleSupport, NSCoding._FloatSupport, NSCoding._IntegerSupport, NSCoding._LongSupport, NSCoding._NumberSupport, NSCoding._ShortSupport, NSCoding._StringSupport |
| Methods inherited from class com.webobjects.eocontrol.EOKeyValueQualifier |
_accept, addQualifierKeysToSet, classForCoder, decodeObject, decodeWithKeyValueUnarchiver, encodeWithCoder, encodeWithKeyValueArchiver, equals, key, qualifierWithBindings, selector, validateKeysWithRootClassDescription, value |
| Methods inherited from class com.webobjects.eocontrol.EOQualifier |
_isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector |
log
protected static final Logger log
- logging support
IsContainedInArraySelectorName
public static String IsContainedInArraySelectorName
ERXPrimaryKeyListQualifier
public 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
public 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 nameeos - array of enterprise objects
ERXPrimaryKeyListQualifier
public 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 nameforeignKey - attribute name.eos - array of enterprise objects
clone
public Object clone()
- Overrides:
clone in class ERXInQualifier
primaryKeyNameForObjects
protected static String primaryKeyNameForObjects(NSArray eos)
- 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.
validateObjects
protected static NSArray validateObjects(NSArray eos)
- 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.
Copyright © 2002 – 2007 Project Wonder.