Package org.teiid.query.sql.lang
Class StoredProcedure
- java.lang.Object
-
- org.teiid.query.sql.lang.Command
-
- org.teiid.query.sql.lang.ProcedureContainer
-
- org.teiid.query.sql.lang.StoredProcedure
-
- All Implemented Interfaces:
Cloneable
,TargetedCommand
,LanguageObject
public class StoredProcedure extends ProcedureContainer
Represents a StoredProcedure statement of the form:
-
-
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 StoredProcedure()
Constructs a default instance of this class.
-
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.void
clearParameters()
Object
clone()
Implement clone to make objects cloneable.boolean
displayNamedParameters()
Indicates whether parameters should be displayed in traditional indexed manor, or as named parametersboolean
equals(Object obj)
GroupSymbol
getGroup()
List<SPParameter>
getInputParameters()
Map<Integer,SPParameter>
getMapOfParameters()
Object
getModelID()
int
getNumberOfColumns()
SPParameter
getParameter(int index)
Collection<SPParameter>
getParameters()
Returns a List of SPParameter objects for this stored procedureString
getProcedureCallableName()
Object
getProcedureID()
String
getProcedureName()
Get this stored procedure's nameLinkedHashMap<ElementSymbol,Expression>
getProcedureParameters()
List
getProjectedSymbols()
Get the ordered list of all elements returned by this query.ElementSymbol
getResultSetColumn(int index)
List<ElementSymbol>
getResultSetColumns()
int
getType()
Return type of command.int
hashCode()
boolean
isCallableStatement()
boolean
isCalledWithReturn()
boolean
isProcedureRelational()
boolean
isPushedInQuery()
boolean
isReadOnly()
boolean
isSupportsExpressionParameters()
boolean
returnParameters()
boolean
returnsResultSet()
boolean
returnsScalarValue()
void
setCallableStatement(boolean isCallableStatement)
void
setCalledWithReturn(boolean calledWithReturn)
void
setDisplayNamedParameters(boolean displayNamedParameters)
Indicate whether parameters should be displayed in traditional indexed manor, or as named parametersvoid
setGroup(GroupSymbol group)
void
setModelID(Object modelID)
void
setParameter(SPParameter parameter)
Set a stored procedure's parametervoid
setProcedureCallableName(String callableName)
void
setProcedureID(Object procedureID)
void
setProcedureName(String procedureName)
Set this stored procedure's namevoid
setProcedureRelational(boolean isProcedureRelational)
void
setPushedInQuery(boolean pushedInQuery)
void
setSupportsExpressionParameters(boolean supportsExpressionParameters)
String
toString()
Returns a string representation of an instance of this class.-
Methods inherited from class org.teiid.query.sql.lang.ProcedureContainer
addTag, copyMetadataState, getUpdateCount, getUpdateInfo, hasTag, setUpdateCount, setUpdateInfo
-
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
-
-
-
-
Method Detail
-
getType
public int getType()
Return type of command.
-
setProcedureName
public void setProcedureName(String procedureName)
Set this stored procedure's name- Parameters:
procedureName
- the stored procedure's name
-
getProcedureName
public String getProcedureName()
Get this stored procedure's name- Returns:
- procedureName the stored procedure's name
-
getProcedureCallableName
public String getProcedureCallableName()
-
setProcedureCallableName
public void setProcedureCallableName(String callableName)
-
getModelID
public Object getModelID()
-
setModelID
public void setModelID(Object modelID)
-
setProcedureID
public void setProcedureID(Object procedureID)
-
getProcedureID
public Object getProcedureID()
-
setParameter
public void setParameter(SPParameter parameter)
Set a stored procedure's parameter- Parameters:
parameter
-StoredProcedureParameter
the parameter- Throws:
IllegalArgumentException
- if the parameters (index and parameter) are invalid.
-
getParameters
public Collection<SPParameter> getParameters()
Returns a List of SPParameter objects for this stored procedure
-
getMapOfParameters
public Map<Integer,SPParameter> getMapOfParameters()
-
getParameter
public SPParameter getParameter(int index)
-
getNumberOfColumns
public int getNumberOfColumns()
-
getResultSetColumn
public ElementSymbol getResultSetColumn(int index)
-
getResultSetColumns
public List<ElementSymbol> getResultSetColumns()
- Overrides:
getResultSetColumns
in classCommand
- Returns:
- null if unknown, empty if results are not returned, or the resultset columns
-
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()
Description copied from interface:LanguageObject
Implement clone to make objects cloneable.- Specified by:
clone
in interfaceLanguageObject
- Specified by:
clone
in classCommand
- Returns:
- Deep clone of this object
-
returnsResultSet
public boolean returnsResultSet()
- Overrides:
returnsResultSet
in classCommand
-
returnsScalarValue
public boolean returnsScalarValue()
-
returnParameters
public boolean returnParameters()
-
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 ElementSymbol
-
toString
public String toString()
Returns a string representation of an instance of this class.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
clearParameters
public void clearParameters()
-
setGroup
public void setGroup(GroupSymbol group)
-
getGroup
public GroupSymbol getGroup()
-
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()
-
displayNamedParameters
public boolean displayNamedParameters()
Indicates whether parameters should be displayed in traditional indexed manor, or as named parameters- Returns:
- Returns whether to display parameters as named or not
- Since:
- 4.3
-
setDisplayNamedParameters
public void setDisplayNamedParameters(boolean displayNamedParameters)
Indicate whether parameters should be displayed in traditional indexed manor, or as named parameters- Parameters:
displayNamedParameters
- whether to display parameters as named or not- Since:
- 4.3
-
getInputParameters
public List<SPParameter> getInputParameters()
-
isProcedureRelational
public boolean isProcedureRelational()
-
setProcedureRelational
public void setProcedureRelational(boolean isProcedureRelational)
-
isCallableStatement
public boolean isCallableStatement()
-
setCallableStatement
public void setCallableStatement(boolean isCallableStatement)
-
getProcedureParameters
public LinkedHashMap<ElementSymbol,Expression> getProcedureParameters()
-
setCalledWithReturn
public void setCalledWithReturn(boolean calledWithReturn)
-
isCalledWithReturn
public boolean isCalledWithReturn()
-
isPushedInQuery
public boolean isPushedInQuery()
-
setPushedInQuery
public void setPushedInQuery(boolean pushedInQuery)
-
isReadOnly
public boolean isReadOnly()
-
setSupportsExpressionParameters
public void setSupportsExpressionParameters(boolean supportsExpressionParameters)
-
isSupportsExpressionParameters
public boolean isSupportsExpressionParameters()
-
-