public abstract class Command extends Object implements LanguageObject
LanguageObject.Util
Modifier and Type | Field and Description |
---|---|
protected TempMetadataStore |
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_SOURCE_EVENT |
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 and Description |
---|
Command() |
Modifier and Type | Method and Description |
---|---|
void |
addExternalGroupToContext(GroupSymbol group) |
abstract boolean |
areResultsCachable()
Whether the results are cachable.
|
abstract Object |
clone()
Implement clone to make objects cloneable.
|
protected void |
copyMetadataState(Command copy) |
List<GroupSymbol> |
getAllExternalGroups() |
CacheHint |
getCacheHint() |
static String |
getCommandToken(int commandType) |
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 List<Expression> |
getProjectedSymbols()
Get the ordered list of all elements returned by this query.
|
List<? extends Expression> |
getResultSetColumns() |
SourceHint |
getSourceHint() |
TempMetadataStore |
getTemporaryMetadata() |
abstract int |
getType()
Return type of command to make it easier to build switch statements by command type.
|
static List<Expression> |
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.
|
String |
printCommandTree()
Print the full tree of commands with indentation - useful for debugging
|
protected void |
printCommandTree(StringBuffer str,
int tabLevel)
Helper method to print command tree at given tab level
|
void |
pushNewResolvingContext(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 |
setSourceHint(SourceHint sourceHint) |
void |
setTemporaryMetadata(TempMetadataStore metadata) |
String |
toString()
Returns a string representation of an instance of this class.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptVisitor
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_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
public static final int TYPE_SOURCE_EVENT
protected TempMetadataStore tempGroupIDs
public abstract int getType()
public SymbolMap getCorrelatedReferences()
public void setCorrelatedReferences(SymbolMap correlatedReferences)
public void setTemporaryMetadata(TempMetadataStore metadata)
public TempMetadataStore getTemporaryMetadata()
public void addExternalGroupToContext(GroupSymbol group)
public void setExternalGroupContexts(GroupContext root)
public void pushNewResolvingContext(Collection<GroupSymbol> groups)
public GroupContext getExternalGroupContexts()
public List<GroupSymbol> getAllExternalGroups()
public boolean isResolved()
public void setIsResolved(boolean isResolved)
isResolved
- whether this command is resolved or notpublic abstract Object clone()
LanguageObject
clone
in interface LanguageObject
clone
in class Object
protected void copyMetadataState(Command copy)
public String printCommandTree()
protected void printCommandTree(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 List<Expression> getProjectedSymbols()
public abstract boolean areResultsCachable()
public static List<Expression> getUpdateCommandSymbol()
public ProcessorPlan getProcessorPlan()
public void setProcessorPlan(ProcessorPlan plan)
public CacheHint getCacheHint()
public void setCacheHint(CacheHint cacheHint)
public SourceHint getSourceHint()
public void setSourceHint(SourceHint sourceHint)
public String toString()
protected boolean sameOptionAndHint(Command cmd)
public boolean returnsResultSet()
public List<? extends Expression> getResultSetColumns()
public static String getCommandToken(int commandType)
Copyright © 2018 JBoss by Red Hat. All rights reserved.