com.metamatrix.query.sql.proc
Class CreateUpdateProcedureCommand

java.lang.Object
  extended by com.metamatrix.query.sql.lang.Command
      extended by com.metamatrix.query.sql.proc.CreateUpdateProcedureCommand
All Implemented Interfaces:
LanguageObject, java.io.Serializable, java.lang.Cloneable

public class CreateUpdateProcedureCommand
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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.metamatrix.query.sql.lang.Command
tempGroupIDs, TYPE_BATCHED_UPDATE, TYPE_CREATE, TYPE_DELETE, TYPE_DROP, TYPE_DYNAMIC, TYPE_INSERT, TYPE_QUERY, TYPE_SQL, TYPE_STORED_PROCEDURE, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_UPDATE_PROCEDURE, TYPE_XQUERY
 
Constructor Summary
CreateUpdateProcedureCommand()
          Constructor for CreateUpdateProcedureCommand.
CreateUpdateProcedureCommand(Block block)
          Constructor for CreateUpdateProcedureCommand.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 boolean areResultsCachable()
          Whether the results are cachable.
 java.lang.Object clone()
          Deep clone statement to produce a new identical statement.
 boolean equals(java.lang.Object obj)
          Compare two CreateUpdateProcedureCommand for equality.
 Block getBlock()
          Get the block on this command.
 java.util.List getParentProjectSymbols()
           
 java.util.List getProjectedSymbols()
          Get the ordered list of all elements returned by this query.
 Command getResultsCommand()
           
 java.util.Map getSymbolMap()
          Get the symbol map between elements on the virtual group being updated and the elements on the transformation query.
 int getType()
          Return type of command to make it easier to build switch statements by command type.
 Command getUserCommand()
          Get the user's command to which this obj which is the subcommand
 int hashCode()
          Get hashcode for CreateUpdateProcedureCommand.
 boolean isUpdateProcedure()
           
 void setBlock(Block block)
          Set the block on this command.
 void setParentProjectSymbols(java.util.List parentProjectSymbols)
           
 void setProjectedSymbols(java.util.List projSymbols)
           
 void setResultsCommand(Command command)
           
 void setSymbolMap(java.util.Map symbolMap)
          Set the symbol map between elements on the virtual group being updated and the elements on the transformation query.
 void setUpdateProcedure(boolean isUpdateProcedure)
           
 void setUserCommand(Command command)
          Set the user's command to which this obj which is the subcommand
 java.lang.String toString()
          Returns a string representation of an instance of this class.
 int updatingModelCount(QueryMetadataInterface metadata)
          Return the number of updates on physical sources by this command.
 
Methods inherited from class com.metamatrix.query.sql.lang.Command
addExternalGroupsToContext, addExternalGroupToContext, copyMetadataState, getAllExternalGroups, getExternalGroupContexts, getOption, getSubCommands, getSubCommandsUpdatingModelCount, getSubCommandsUpdatingModelCount, getTemporaryMetadata, getUpdateCommandSymbol, getUpdatesCommandSymbol, getVariableValues, getVirtualGroup, isResolved, printCommandTree, printCommandTree, pushNewResolvingContext, setExternalGroupContexts, setIsResolved, setOption, setTemporaryMetadata, setVariableValues, setVirtualGroup
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateUpdateProcedureCommand

public CreateUpdateProcedureCommand()
Constructor for CreateUpdateProcedureCommand.


CreateUpdateProcedureCommand

public CreateUpdateProcedureCommand(Block block)
Constructor for CreateUpdateProcedureCommand.

Parameters:
block - The block on this command
type - The procedure type
Method Detail

getType

public int getType()
Return type of command to make it easier to build switch statements by command type.

Specified by:
getType in class Command
Returns:
The type of this command

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 - The Block on this command

setUserCommand

public void setUserCommand(Command command)
Set the user's command to which this obj which is the subcommand

Parameters:
command - The user's command

getUserCommand

public Command getUserCommand()
Get the user's command to which this obj which is the subcommand

Returns:
The user's command

setSymbolMap

public void setSymbolMap(java.util.Map symbolMap)
Set the symbol map between elements on the virtual group being updated and the elements on the transformation query.

Parameters:
symbolMap - Map of virtual group elements -> elements that define those

getSymbolMap

public java.util.Map getSymbolMap()
Get the symbol map between elements on the virtual group being updated and the elements on the transformation query.

Returns:
Map of virtual group elements -> elements that define those

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 java.lang.Object clone()
Deep clone statement to produce a new identical statement.

Specified by:
clone in interface LanguageObject
Specified by:
clone in class Command
Returns:
Deep clone

equals

public boolean equals(java.lang.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.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if 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.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

toString

public java.lang.String toString()
Returns a string representation of an instance of this class.

Overrides:
toString in class Command
Returns:
String representation of object

getProjectedSymbols

public java.util.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 class Command
Returns:
Ordered list of SingleElementSymbol

isUpdateProcedure

public boolean isUpdateProcedure()
Returns:

setUpdateProcedure

public void setUpdateProcedure(boolean isUpdateProcedure)
Parameters:
isUpdateProcedure -

setProjectedSymbols

public void setProjectedSymbols(java.util.List projSymbols)
Parameters:
projSymbols -

getResultsCommand

public Command getResultsCommand()
Returns:
Command

setResultsCommand

public void setResultsCommand(Command command)
Parameters:
command -

areResultsCachable

public boolean areResultsCachable()
Description copied from class: Command
Whether the results are cachable.

Specified by:
areResultsCachable in class Command
Returns:
True if the results are cachable; false otherwise.
See Also:
Command.areResultsCachable()

updatingModelCount

public int updatingModelCount(QueryMetadataInterface metadata)
                       throws MetaMatrixComponentException
Description copied from class: Command
Return the number of updates on physical sources by this command.

Specified by:
updatingModelCount in class Command
Parameters:
metadata - QueryMetadataInterface
Returns:
The number of updates on physical sources by this command.
Throws:
MetaMatrixComponentException

getParentProjectSymbols

public java.util.List getParentProjectSymbols()
Returns:
Returns the parentProjectSymbols.

setParentProjectSymbols

public void setParentProjectSymbols(java.util.List parentProjectSymbols)
Parameters:
parentProjectSymbols - The parentProjectSymbols to set.


Copyright © 2009. All Rights Reserved.