|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.query.sql.lang.Command
public abstract class Command
A Command is an interface for all the language objects that are at the root of a language object tree representing a SQL statement. For instance, a Query command represents a SQL select query, an Update command represents a SQL update statement, etc.
Field Summary | |
---|---|
protected java.util.Map |
tempGroupIDs
All temporary group IDs discovered while resolving this command. |
static int |
TYPE_BATCHED_UPDATE
Represents a batched sequence of UPDATE statements |
static int |
TYPE_CREATE
|
static int |
TYPE_DELETE
Represents a SQL DELETE statement |
static int |
TYPE_DROP
|
static int |
TYPE_DYNAMIC
|
static int |
TYPE_INSERT
Represents a SQL INSERT statement |
static int |
TYPE_QUERY
Represents a SQL SELECT statement |
static int |
TYPE_SQL
Represents any SQL statement, wrapped as a string |
static int |
TYPE_STORED_PROCEDURE
Represents a stored procedure command |
static int |
TYPE_UNKNOWN
Represents an unknown type of command |
static int |
TYPE_UPDATE
Represents a SQL UPDATE statement |
static int |
TYPE_UPDATE_PROCEDURE
Represents a update stored procedure command |
static int |
TYPE_XQUERY
Represents an XQuery |
Constructor Summary | |
---|---|
Command()
|
Method Summary | |
---|---|
void |
addExternalGroupsToContext(java.util.Collection groups)
|
void |
addExternalGroupToContext(GroupSymbol group)
|
abstract boolean |
areResultsCachable()
Whether the results are cachable. |
abstract java.lang.Object |
clone()
Implement clone to make objects cloneable. |
protected void |
copyMetadataState(Command copy)
|
java.util.List |
getAllExternalGroups()
|
GroupContext |
getExternalGroupContexts()
|
Option |
getOption()
Get the option clause for the query. |
abstract java.util.List<SingleElementSymbol> |
getProjectedSymbols()
Get the ordered list of all elements returned by this query. |
java.util.List |
getSubCommands()
Gets the subCommands (both embedded and non-embedded) under this command. |
static int |
getSubCommandsUpdatingModelCount(LanguageObject object,
QueryMetadataInterface metadata)
|
protected int |
getSubCommandsUpdatingModelCount(QueryMetadataInterface metadata)
|
java.util.Map |
getTemporaryMetadata()
|
abstract int |
getType()
Return type of command to make it easier to build switch statements by command type. |
static java.util.List |
getUpdateCommandSymbol()
|
static java.util.List |
getUpdatesCommandSymbol()
|
java.util.Map |
getVariableValues()
|
GroupSymbol |
getVirtualGroup()
|
boolean |
isResolved()
Indicates whether this command has been resolved or not - attempting to resolve a command that has already been resolved has undefined results. |
java.lang.String |
printCommandTree()
Print the full tree of commands with indentation - useful for debugging |
protected void |
printCommandTree(java.lang.StringBuffer str,
int tabLevel)
Helper method to print command tree at given tab level |
void |
pushNewResolvingContext(java.util.Collection groups)
|
void |
setExternalGroupContexts(GroupContext root)
|
void |
setIsResolved(boolean isResolved)
This command is intended to only be used by the QueryResolver. |
void |
setOption(Option option)
Set the option clause for the query. |
void |
setTemporaryMetadata(java.util.Map metadata)
|
void |
setVariableValues(java.util.Map parameters)
|
void |
setVirtualGroup(GroupSymbol virtualGroup)
|
java.lang.String |
toString()
Returns a string representation of an instance of this class. |
abstract int |
updatingModelCount(QueryMetadataInterface metadata)
Return the number of updates on physical sources by this command. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.metamatrix.query.sql.LanguageObject |
---|
acceptVisitor |
Field Detail |
---|
public static final int TYPE_UNKNOWN
public static final int TYPE_QUERY
public static final int TYPE_INSERT
public static final int TYPE_UPDATE
public static final int TYPE_DELETE
public static final int TYPE_SQL
public static final int TYPE_STORED_PROCEDURE
public static final int TYPE_UPDATE_PROCEDURE
public static final int TYPE_XQUERY
public static final int TYPE_BATCHED_UPDATE
public static final int TYPE_DYNAMIC
public static final int TYPE_CREATE
public static final int TYPE_DROP
protected java.util.Map tempGroupIDs
Constructor Detail |
---|
public Command()
Method Detail |
---|
public abstract int getType()
public java.util.List getSubCommands()
public void setTemporaryMetadata(java.util.Map metadata)
public java.util.Map getTemporaryMetadata()
public void addExternalGroupToContext(GroupSymbol group)
public void addExternalGroupsToContext(java.util.Collection groups)
public void setExternalGroupContexts(GroupContext root)
public void pushNewResolvingContext(java.util.Collection groups)
public GroupContext getExternalGroupContexts()
public java.util.List getAllExternalGroups()
public boolean isResolved()
public void setIsResolved(boolean isResolved)
isResolved
- whether this command is resolved or notpublic abstract java.lang.Object clone()
LanguageObject
clone
in interface LanguageObject
clone
in class java.lang.Object
protected void copyMetadataState(Command copy)
public java.lang.String printCommandTree()
protected void printCommandTree(java.lang.StringBuffer str, int tabLevel)
str
- String buffer to add command sub tree totabLevel
- Number of tabs to print this command atpublic Option getOption()
public void setOption(Option option)
option
- New option clausepublic abstract java.util.List<SingleElementSymbol> getProjectedSymbols()
public abstract boolean areResultsCachable()
public static java.util.List getUpdateCommandSymbol()
public static java.util.List getUpdatesCommandSymbol()
public abstract int updatingModelCount(QueryMetadataInterface metadata) throws MetaMatrixComponentException
metadata
- QueryMetadataInterface
MetaMatrixComponentException
protected int getSubCommandsUpdatingModelCount(QueryMetadataInterface metadata) throws MetaMatrixComponentException
MetaMatrixComponentException
public static int getSubCommandsUpdatingModelCount(LanguageObject object, QueryMetadataInterface metadata) throws MetaMatrixComponentException
MetaMatrixComponentException
public GroupSymbol getVirtualGroup()
public void setVirtualGroup(GroupSymbol virtualGroup)
public java.util.Map getVariableValues()
public void setVariableValues(java.util.Map parameters)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |