Project Wonder 2.0

er.extensions
Class ERXQualifierInSubquery

java.lang.Object
  extended bycom.webobjects.eocontrol.EOQualifier
      extended byer.extensions.ERXQualifierInSubquery
All Implemented Interfaces:
Cloneable, EOQualifierEvaluation, EOQualifierSQLGeneration, Serializable

public class ERXQualifierInSubquery
extends EOQualifier
implements EOQualifierSQLGeneration, Cloneable

Generates a subquery for the qualifier given in argument ... t0.ID IN (SELECT t0.ID FROM X WHERE ) .. this class can be used to work around the EOF bug where OR queries involving many-to-manies are incorrectly generated It will also generate ... t0.FOREIGN_KEY_ID in (select t1.ID from X where ) with the 3 arg constructor

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
 
Nested classes inherited from class com.webobjects.eoaccess.EOQualifierSQLGeneration
EOQualifierSQLGeneration._AndQualifierSupport, EOQualifierSQLGeneration._KeyComparisonQualifierSupport, EOQualifierSQLGeneration._KeyValueQualifierSupport, EOQualifierSQLGeneration._NotQualifierSupport, EOQualifierSQLGeneration._OrQualifierSupport, EOQualifierSQLGeneration.Support
 
Field Summary
protected  String attributeName
          holds the attribute name
protected  String destinationAttName
           
protected  String entityName
          holds the entity name
static ERXLogger log
          logging support
protected  EOQualifier qualifier
          holds the subqualifier
 
Fields inherited from class com.webobjects.eocontrol.EOQualifier
_CLASS, QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
 
Constructor Summary
ERXQualifierInSubquery(EOQualifier q)
          Public single argument constructor.
ERXQualifierInSubquery(EOQualifier q, String entityName, String attributeName, String destinationAttName)
          Public three argument constructor.
 
Method Summary
 void addQualifierKeysToSet(NSMutableSet aSet)
          Only used with qualifier keys which are not supported in this qualifier at this time.
 Object clone()
          Implementation of the Clonable interface.
 EOQualifier qualifierMigratedFromEntityRelationshipPath(EOEntity anEntity, String aPath)
          Implementation of the EOQualifierSQLGeneration interface.
 EOQualifier qualifierWithBindings(NSDictionary someBindings, boolean requiresAll)
          Creates another qualifier after replacing the values of the bindings.
 EOQualifier schemaBasedQualifierWithRootEntity(EOEntity anEntity)
          Implementation of the EOQualifierSQLGeneration interface.
 String sqlStringForSQLExpression(EOSQLExpression e)
          Generates the sql string for the given sql expression.
 String toString()
          Description of the qualifier
 void validateKeysWithRootClassDescription(EOClassDescription aClassDescription)
          This qualifier does not perform validation.
 
Methods inherited from class com.webobjects.eocontrol.EOQualifier
_accept, _isEmpty, allQualifierKeys, allQualifierOperators, bindingKeys, evaluateWithObject, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


qualifier

protected EOQualifier qualifier
holds the subqualifier


entityName

protected String entityName
holds the entity name


attributeName

protected String attributeName
holds the attribute name


destinationAttName

protected String destinationAttName
Constructor Detail

ERXQualifierInSubquery

public ERXQualifierInSubquery(EOQualifier q)
Public single argument constructor. Use this constructor for sub-qualification on the same table.

Parameters:
q - sub-qualifier

ERXQualifierInSubquery

public ERXQualifierInSubquery(EOQualifier q,
                              String entityName,
                              String attributeName,
                              String destinationAttName)
Public three argument constructor. Use this constructor for for building queries on foreign key attributes of the current entity.

Parameters:
q - sub qualifier
entityName - of the sub qualification
attributeName - foriegn key attribute name
Method Detail

addQualifierKeysToSet

public void addQualifierKeysToSet(NSMutableSet aSet)
Only used with qualifier keys which are not supported in this qualifier at this time. Does nothing.

Parameters:
aSet - of qualifier keys

qualifierWithBindings

public EOQualifier qualifierWithBindings(NSDictionary someBindings,
                                         boolean requiresAll)
Creates another qualifier after replacing the values of the bindings. Since this qualifier does not support qualifier binding keys a clone of the qualifier is returned.

Parameters:
someBindings - some bindings
requiresAll - tells if the qualifier requires all bindings
Returns:
clone of the current qualifier.

validateKeysWithRootClassDescription

public void validateKeysWithRootClassDescription(EOClassDescription aClassDescription)
This qualifier does not perform validation. This is a no-op method.

Parameters:
aClassDescription - to validation the qualifier keys against.

sqlStringForSQLExpression

public String sqlStringForSQLExpression(EOSQLExpression e)
Generates the sql string for the given sql expression. Bulk of the logic for generating the sub-query is in this method.

Specified by:
sqlStringForSQLExpression in interface EOQualifierSQLGeneration
Parameters:
e - a given sql expression
Returns:
sql string for the current sub-query.

schemaBasedQualifierWithRootEntity

public EOQualifier schemaBasedQualifierWithRootEntity(EOEntity anEntity)
Implementation of the EOQualifierSQLGeneration interface. Just clones the qualifier.

Specified by:
schemaBasedQualifierWithRootEntity in interface EOQualifierSQLGeneration
Parameters:
anEntity - an entity.
Returns:
clone of the current qualifier.

qualifierMigratedFromEntityRelationshipPath

public EOQualifier qualifierMigratedFromEntityRelationshipPath(EOEntity anEntity,
                                                               String aPath)
Implementation of the EOQualifierSQLGeneration interface. Just clones the qualifier.

Specified by:
qualifierMigratedFromEntityRelationshipPath in interface EOQualifierSQLGeneration
Parameters:
anEntity - an entity
aPath - relationship path
Returns:
clone of the current qualifier.

toString

public String toString()
Description of the qualifier

Returns:
human readable description of the qualifier.

clone

public Object clone()
Implementation of the Clonable interface. Clones the current qualifier.

Returns:
cloned qualifier.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.