Package org.teiid.query.sql.proc
Class CreateProcedureCommand
- java.lang.Object
-
- org.teiid.query.sql.lang.Command
-
- org.teiid.query.sql.proc.CreateProcedureCommand
-
- All Implemented Interfaces:
Cloneable
,LanguageObject
public class CreateProcedureCommand extends Command
This class represents a update procedure in the storedprocedure language. It extends the
Command
and represents the command for Insert , Update and Delete procedures.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Field Summary
-
Fields inherited from class org.teiid.query.sql.lang.Command
tempGroupIDs, TYPE_ALTER_PROC, TYPE_ALTER_TRIGGER, TYPE_ALTER_VIEW, TYPE_BATCHED_UPDATE, TYPE_CREATE, TYPE_DELETE, TYPE_DROP, TYPE_DYNAMIC, TYPE_EXPLAIN, TYPE_INSERT, TYPE_QUERY, TYPE_SOURCE_EVENT, TYPE_STORED_PROCEDURE, TYPE_TRIGGER_ACTION, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_UPDATE_PROCEDURE
-
-
Constructor Summary
Constructors Constructor Description CreateProcedureCommand()
Constructor for CreateUpdateProcedureCommand.CreateProcedureCommand(Block block)
Constructor for CreateUpdateProcedureCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.boolean
areResultsCachable()
Whether the results are cachable.Object
clone()
Deep clone statement to produce a new identical statement.boolean
equals(Object obj)
Compare two CreateUpdateProcedureCommand for equality.Block
getBlock()
Get the block on this command.List
getProjectedSymbols()
Get the ordered list of all elements returned by this query.List<? extends Expression>
getResultSetColumns()
ElementSymbol
getReturnVariable()
int
getType()
Return type of command to make it easier to build switch statements by command type.int
getUpdateType()
GroupSymbol
getVirtualGroup()
int
hashCode()
Get hashcode for CreateUpdateProcedureCommand.boolean
returnsResultSet()
void
setBlock(Block block)
Set the block on this command.void
setProjectedSymbols(List projSymbols)
void
setResultSetColumns(List<? extends Expression> resultSetColumns)
void
setReturnVariable(ElementSymbol symbol)
void
setUpdateType(int type)
void
setVirtualGroup(GroupSymbol virtualGroup)
String
toString()
Returns a string representation of an instance of this class.-
Methods inherited from class org.teiid.query.sql.lang.Command
addExternalGroupToContext, copyMetadataState, getActualCommand, getAllExternalGroups, getCacheHint, getCommandToken, getCorrelatedReferences, getExternalGroupContexts, getOption, getProcessorPlan, getSourceHint, getTemporaryMetadata, getUpdateCommandSymbol, printCommandTree, printCommandTree, pushNewResolvingContext, sameOptionAndHint, setCacheHint, setCorrelatedReferences, setExternalGroupContexts, setOption, setProcessorPlan, setSourceHint, setTemporaryMetadata
-
-
-
-
Constructor Detail
-
CreateProcedureCommand
public CreateProcedureCommand()
Constructor for CreateUpdateProcedureCommand.
-
CreateProcedureCommand
public CreateProcedureCommand(Block block)
Constructor for CreateUpdateProcedureCommand.- Parameters:
block
- The block on this command
-
-
Method Detail
-
getType
public int getType()
Return type of command to make it easier to build switch statements by command type.
-
getBlock
public Block getBlock()
Get the block on this command.- Returns:
- The
Block
on this command
-
setBlock
public void setBlock(Block block)
Set the block on this command.- Parameters:
block
- TheBlock
on this command
-
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.- Parameters:
visitor
- Visitor being used
-
clone
public Object clone()
Deep clone statement to produce a new identical statement.- Specified by:
clone
in interfaceLanguageObject
- Specified by:
clone
in classCommand
- Returns:
- Deep clone
-
equals
public boolean equals(Object obj)
Compare two CreateUpdateProcedureCommand for equality. They will only evaluate to equal if they are IDENTICAL: the commandTypes are same and the block objects are equal.
-
hashCode
public int hashCode()
Get hashcode for CreateUpdateProcedureCommand. WARNING: This hash code relies on the hash codes of the block and the procedure type of this command. Hash code is only valid after the command has been completely constructed.
-
toString
public String toString()
Returns a string representation of an instance of this class.
-
getProjectedSymbols
public List getProjectedSymbols()
Get the ordered list of all elements returned by this query. These elements may be ElementSymbols or ExpressionSymbols but in all cases each represents a single column.- Specified by:
getProjectedSymbols
in classCommand
- Returns:
- Ordered list of SingleElementSymbol
-
getResultSetColumns
public List<? extends Expression> getResultSetColumns()
- Overrides:
getResultSetColumns
in classCommand
- Returns:
- null if unknown, empty if results are not returned, or the resultset columns
-
setResultSetColumns
public void setResultSetColumns(List<? extends Expression> resultSetColumns)
-
setProjectedSymbols
public void setProjectedSymbols(List projSymbols)
- Parameters:
projSymbols
-
-
areResultsCachable
public boolean areResultsCachable()
Description copied from class:Command
Whether the results are cachable.- Specified by:
areResultsCachable
in classCommand
- Returns:
- True if the results are cachable; false otherwise.
- See Also:
Command.areResultsCachable()
-
getVirtualGroup
public GroupSymbol getVirtualGroup()
-
setVirtualGroup
public void setVirtualGroup(GroupSymbol virtualGroup)
-
setUpdateType
public void setUpdateType(int type)
-
getUpdateType
public int getUpdateType()
-
setReturnVariable
public void setReturnVariable(ElementSymbol symbol)
-
getReturnVariable
public ElementSymbol getReturnVariable()
-
returnsResultSet
public boolean returnsResultSet()
- Overrides:
returnsResultSet
in classCommand
-
-