com.metamatrix.query.sql.lang
Class SubqueryFromClause

java.lang.Object
  extended by com.metamatrix.query.sql.lang.FromClause
      extended by com.metamatrix.query.sql.lang.SubqueryFromClause
All Implemented Interfaces:
SubqueryContainer, LanguageObject, java.io.Serializable, java.lang.Cloneable

public class SubqueryFromClause
extends FromClause
implements SubqueryContainer

A FROM subpart that represents a subquery. For example, the FROM clause: "FROM (SELECT a FROM b)" will have a SubqueryFromClause referencing the subquery.

See Also:
Serialized Form

Constructor Summary
SubqueryFromClause(GroupSymbol symbol, Command command)
           
SubqueryFromClause(java.lang.String name)
          Construct default object
SubqueryFromClause(java.lang.String name, Command command)
          Construct object with specified command and name
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 java.lang.Object clone()
          Get deep clone of object
 void collectGroups(java.util.Collection groups)
          Collect all GroupSymbols for this from clause.
 boolean equals(java.lang.Object obj)
          Check whether objects are equal
 Command getCommand()
          Get command held by clause
 GroupSymbol getGroupSymbol()
          Get GroupSymbol representing the named subquery
 java.lang.String getName()
          Get name of this clause.
 java.lang.String getOutputName()
           
 int hashCode()
          Get hash code of object
 void setCommand(Command command)
          Set the command held by the clause
 void setName(java.lang.String name)
          Reset the alias for this subquery from clause and it's pseudo-GroupSymbol.
 java.lang.String toString()
          Returns a string representation of an instance of this class.
 
Methods inherited from class com.metamatrix.query.sql.lang.FromClause
hasHint, isMakeDep, isMakeNotDep, isOptional, setMakeDep, setMakeNotDep, setOptional
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubqueryFromClause

public SubqueryFromClause(java.lang.String name)
Construct default object


SubqueryFromClause

public SubqueryFromClause(java.lang.String name,
                          Command command)
Construct object with specified command and name

Parameters:
command - Command representing subquery, or stored procedure
name - Alias of the subquery

SubqueryFromClause

public SubqueryFromClause(GroupSymbol symbol,
                          Command command)
Method Detail

setName

public void setName(java.lang.String name)
Reset the alias for this subquery from clause and it's pseudo-GroupSymbol. WARNING: this will modify the hashCode and equals semantics and will cause this object to be lost if currently in a HashMap or HashSet.

Parameters:
name - New name
Since:
4.3

setCommand

public void setCommand(Command command)
Set the command held by the clause

Specified by:
setCommand in interface SubqueryContainer
Parameters:
command - Command to hold

getCommand

public Command getCommand()
Get command held by clause

Specified by:
getCommand in interface SubqueryContainer
Returns:
Command held by clause

getName

public java.lang.String getName()
Get name of this clause.

Returns:
Name of clause

getOutputName

public java.lang.String getOutputName()

getGroupSymbol

public GroupSymbol getGroupSymbol()
Get GroupSymbol representing the named subquery

Returns:
GroupSymbol representing the subquery

collectGroups

public void collectGroups(java.util.Collection groups)
Collect all GroupSymbols for this from clause.

Specified by:
collectGroups in class FromClause
Parameters:
groups - Groups to add to

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
Specified by:
acceptVisitor in class FromClause
Parameters:
visitor - Visitor being used

equals

public boolean equals(java.lang.Object obj)
Check whether objects are equal

Overrides:
equals in class FromClause
Parameters:
obj - Other object
Returns:
True if equal

hashCode

public int hashCode()
Get hash code of object

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

clone

public java.lang.Object clone()
Get deep clone of object

Specified by:
clone in interface LanguageObject
Specified by:
clone in class FromClause
Returns:
Deep copy of the object

toString

public java.lang.String toString()
Returns a string representation of an instance of this class.

Overrides:
toString in class java.lang.Object
Returns:
String representation of object


Copyright © 2009. All Rights Reserved.