com.metamatrix.query.sql.lang
Class SubquerySetCriteria
java.lang.Object
com.metamatrix.query.sql.lang.Criteria
com.metamatrix.query.sql.lang.PredicateCriteria
com.metamatrix.query.sql.lang.AbstractSetCriteria
com.metamatrix.query.sql.lang.SubquerySetCriteria
- All Implemented Interfaces:
- SubqueryContainer, LanguageObject, ValueIteratorProvider, java.io.Serializable, java.lang.Cloneable
public class SubquerySetCriteria
- extends AbstractSetCriteria
- implements SubqueryContainer
A criteria which is true is the expression's value is a member in a list
of values returned from a subquery. This criteria can be represented as
" IN (SELECT ...)".
- See Also:
- Serialized Form
Method Summary |
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor. |
java.lang.Object |
clone()
Deep copy of object. |
boolean |
equals(java.lang.Object obj)
Override equals() method. |
Command |
getCommand()
Get the subquery command used to produce the values for this SetCriteria. |
ValueIterator |
getValueIterator()
Returns always the same instance of a ValueIterator, but
resets it each time this method is called |
int |
hashCode()
Get hash code. |
void |
setCommand(Command command)
Set the subquery command (either a SELECT or a procedure execution). |
void |
setValueIterator(ValueIterator valueIterator)
Set the ValueIterator on this object (the ValueIterator will encapsulate
the single-column results of the subquery processor plan). |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
SubquerySetCriteria
public SubquerySetCriteria()
- Constructor for SubquerySetCriteria.
SubquerySetCriteria
public SubquerySetCriteria(Expression expression,
Command subCommand)
setCommand
public void setCommand(Command command)
- Set the subquery command (either a SELECT or a procedure execution).
- Specified by:
setCommand
in interface SubqueryContainer
- Parameters:
command
- Command to execute to get the values for the criteria
getCommand
public Command getCommand()
- Get the subquery command used to produce the values for this SetCriteria.
- Specified by:
getCommand
in interface SubqueryContainer
- Returns:
- Command Command to execute
getValueIterator
public ValueIterator getValueIterator()
- Returns always the same instance of a ValueIterator, but
resets
it each time this method is called
- Specified by:
getValueIterator
in interface ValueIteratorProvider
- Specified by:
getValueIterator
in class AbstractSetCriteria
- Returns:
- this object's ValueIterator instance (always the same instance)
- Throws:
MetaMatrixRuntimeException
- if the subquery for this set criteria
has not yet been processed and no value iterator is available- See Also:
AbstractSetCriteria.getValueIterator()
setValueIterator
public void setValueIterator(ValueIterator valueIterator)
- Set the ValueIterator on this object (the ValueIterator will encapsulate
the single-column results of the subquery processor plan). This
ValueIterator must be set before processing (before the Criteria can be
evaluated). Also, this ValueIterator should be considered transient -
only available during processing - and it will not be cloned should
this Criteria object be cloned.
- Specified by:
setValueIterator
in interface ValueIteratorProvider
- Specified by:
setValueIterator
in class AbstractSetCriteria
- Parameters:
valueIterator
- encapsulating the results of the sub query- See Also:
ValueIteratorProvider.setValueIterator(com.metamatrix.query.sql.util.ValueIterator)
acceptVisitor
public void acceptVisitor(LanguageVisitor visitor)
- Description copied from interface:
LanguageObject
- Method for accepting a visitor. It is the responsibility of the
language object to call back on the visitor.
- Specified by:
acceptVisitor
in interface LanguageObject
- Parameters:
visitor
- Visitor being used
hashCode
public int hashCode()
- Get hash code. WARNING: The hash code is based on data in the criteria.
If data values are changed, the hash code will change - don't hash this
object and change values.
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- Hash code
equals
public boolean equals(java.lang.Object obj)
- Override equals() method.
- Overrides:
equals
in class java.lang.Object
- Parameters:
obj
- Other object
- Returns:
- True if equal
clone
public java.lang.Object clone()
- Deep copy of object. The values Iterator of this object
will not be cloned - it will be null in the new object
(see #setValueIterator setValueIterator}).
- Specified by:
clone
in interface LanguageObject
- Specified by:
clone
in class AbstractSetCriteria
- Returns:
- Deep copy of object
Copyright © 2009. All Rights Reserved.