er.extensions
Class ERXPrimaryKeyListQualifier
java.lang.Object
com.webobjects.eocontrol.EOQualifier
com.webobjects.eocontrol.EOKeyValueQualifier
er.extensions.ERXInQualifier
er.extensions.ERXPrimaryKeyListQualifier
- All Implemented Interfaces:
- Cloneable, EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, Serializable
- 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 classes inherited from class 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, NSCoding.Support |
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 ERXLogger 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
installSupport
public static void installSupport()
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 – 2004 Project Wonder.