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:
- com.webobjects.eocontrol.EOKeyValueArchiving, com.webobjects.eocontrol.EOQualifierEvaluation, com.webobjects.foundation.NSCoding, IERXChainableQualifier, java.io.Serializable, java.lang.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 class com.webobjects.eocontrol.EOQualifier |
com.webobjects.eocontrol.EOQualifier.Comparison, com.webobjects.eocontrol.EOQualifier.ComparisonSupport, com.webobjects.eocontrol.EOQualifier.QualifierVariableSubstitutionException |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding |
com.webobjects.foundation.NSCoding._BigDecimalSupport, com.webobjects.foundation.NSCoding._BigIntegerSupport, com.webobjects.foundation.NSCoding._BooleanSupport, com.webobjects.foundation.NSCoding._ByteSupport, com.webobjects.foundation.NSCoding._CharacterSupport, com.webobjects.foundation.NSCoding._DateSupport, com.webobjects.foundation.NSCoding._DoubleSupport, com.webobjects.foundation.NSCoding._FloatSupport, com.webobjects.foundation.NSCoding._IntegerSupport, com.webobjects.foundation.NSCoding._LongSupport, com.webobjects.foundation.NSCoding._NumberSupport, com.webobjects.foundation.NSCoding._ShortSupport, com.webobjects.foundation.NSCoding._StringSupport |
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving |
com.webobjects.eocontrol.EOKeyValueArchiving._NullValueSupport, com.webobjects.eocontrol.EOKeyValueArchiving._NumberSupport, com.webobjects.eocontrol.EOKeyValueArchiving._TimestampSupport, com.webobjects.eocontrol.EOKeyValueArchiving.Awaking, com.webobjects.eocontrol.EOKeyValueArchiving.FinishInitialization |
Fields inherited from class com.webobjects.eocontrol.EOKeyValueQualifier |
_CLASS, _key, _lowercaseCache, _selector, _value |
Fields inherited from class com.webobjects.eocontrol.EOQualifier |
QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual |
Constructor Summary |
ERXPrimaryKeyListQualifier(com.webobjects.foundation.NSArray eos)
Constructs a primary key list qualifer for a given
set of enterprise objects. |
ERXPrimaryKeyListQualifier(java.lang.String key,
com.webobjects.foundation.NSArray eos)
Constructs a primary key list qualifer for a given
set of enterprise objects and the primary key
attribute name. |
ERXPrimaryKeyListQualifier(java.lang.String key,
java.lang.String foreignKey,
com.webobjects.foundation.NSArray eos)
Constructs a primary key list qualifer for a given
set of enterprise objects, the primary key
attribute name and a foreign key. |
Method Summary |
java.lang.Object |
clone()
|
protected static java.lang.String |
primaryKeyNameForObjects(com.webobjects.foundation.NSArray eos)
Calculates the primary key attribute name for an
array of enterprise objects. |
protected static com.webobjects.foundation.NSArray |
validateObjects(com.webobjects.foundation.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. |
Methods inherited from class com.webobjects.eocontrol.EOKeyValueQualifier |
_accept, addQualifierKeysToSet, 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 |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
log
protected static final org.apache.log4j.Logger log
- logging support
IsContainedInArraySelectorName
public static final java.lang.String IsContainedInArraySelectorName
- See Also:
- Constant Field Values
ERXPrimaryKeyListQualifier
public ERXPrimaryKeyListQualifier(com.webobjects.foundation.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(java.lang.String key,
com.webobjects.foundation.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(java.lang.String key,
java.lang.String foreignKey,
com.webobjects.foundation.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 java.lang.Object clone()
- Overrides:
clone
in class ERXInQualifier
primaryKeyNameForObjects
protected static java.lang.String primaryKeyNameForObjects(com.webobjects.foundation.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 com.webobjects.foundation.NSArray validateObjects(com.webobjects.foundation.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.