|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject |
---|
LanguageObject.Util |
Field Summary | |
---|---|
protected java.util.Map |
tempGroupIDs
All temporary group IDs discovered while resolving this command. |
static int |
TYPE_ALTER_PROC
|
static int |
TYPE_ALTER_TRIGGER
|
static int |
TYPE_ALTER_VIEW
|
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_TRIGGER_ACTION
|
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 |
Constructor Summary | |
---|---|
Command()
|
Method Summary | |
---|---|
void |
addExternalGroupsToContext(java.util.Collection<GroupSymbol> 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<GroupSymbol> |
getAllExternalGroups()
|
CacheHint |
getCacheHint()
|
SymbolMap |
getCorrelatedReferences()
Get the correlated references to the containing scope only |
GroupContext |
getExternalGroupContexts()
|
Option |
getOption()
Get the option clause for the query. |
ProcessorPlan |
getProcessorPlan()
|
abstract java.util.List<SingleElementSymbol> |
getProjectedSymbols()
Get the ordered list of all elements returned by this query. |
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<SingleElementSymbol> |
getUpdateCommandSymbol()
|
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<GroupSymbol> groups)
|
boolean |
returnsResultSet()
|
protected boolean |
sameOptionAndHint(Command cmd)
|
void |
setCacheHint(CacheHint cacheHint)
|
void |
setCorrelatedReferences(SymbolMap correlatedReferences)
|
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 |
setProcessorPlan(ProcessorPlan plan)
|
void |
setTemporaryMetadata(java.util.Map metadata)
|
java.lang.String |
toString()
Returns a string representation of an instance of this class. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.teiid.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_BATCHED_UPDATE
public static final int TYPE_DYNAMIC
public static final int TYPE_CREATE
public static final int TYPE_DROP
public static final int TYPE_TRIGGER_ACTION
public static final int TYPE_ALTER_VIEW
public static final int TYPE_ALTER_PROC
public static final int TYPE_ALTER_TRIGGER
protected java.util.Map tempGroupIDs
Constructor Detail |
---|
public Command()
Method Detail |
---|
public abstract int getType()
public SymbolMap getCorrelatedReferences()
public void setCorrelatedReferences(SymbolMap correlatedReferences)
public void setTemporaryMetadata(java.util.Map metadata)
public java.util.Map getTemporaryMetadata()
public void addExternalGroupToContext(GroupSymbol group)
public void addExternalGroupsToContext(java.util.Collection<GroupSymbol> groups)
public void setExternalGroupContexts(GroupContext root)
public void pushNewResolvingContext(java.util.Collection<GroupSymbol> groups)
public GroupContext getExternalGroupContexts()
public java.util.List<GroupSymbol> 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<SingleElementSymbol> getUpdateCommandSymbol()
public ProcessorPlan getProcessorPlan()
public void setProcessorPlan(ProcessorPlan plan)
public CacheHint getCacheHint()
public void setCacheHint(CacheHint cacheHint)
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean sameOptionAndHint(Command cmd)
public boolean returnsResultSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |