com.metamatrix.query.resolver.command
Class ExecResolver

java.lang.Object
  extended by com.metamatrix.query.resolver.ProcedureContainerResolver
      extended by com.metamatrix.query.resolver.command.ExecResolver
All Implemented Interfaces:
CommandResolver, VariableResolver

public class ExecResolver
extends ProcedureContainerResolver
implements VariableResolver


Constructor Summary
ExecResolver()
           
 
Method Summary
 void expandCommand(Command command, QueryMetadataInterface metadata, AnalysisRecord analysis)
          Expand a command by finding and attaching all subcommands to the command.
 GroupContext findChildCommandMetadata(Command command, TempMetadataStore childMetadata, boolean useMetadataCommands, QueryMetadataInterface metadata)
          Find all metadata defined by this command for it's children.
protected  java.lang.String getPlan(QueryMetadataInterface metadata, GroupSymbol group)
          For a given resolver, this returns the unparsed command.
 java.util.Map getVariableValues(Command command, QueryMetadataInterface metadata)
          Collect input expressions from a procedure and map them to the parameters they came from
protected  void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand)
           
 void resolveProceduralCommand(Command command, boolean useMetadataCommands, TempMetadataAdapter metadata, AnalysisRecord analysis)
           
 
Methods inherited from class com.metamatrix.query.resolver.ProcedureContainerResolver
addScalarGroup, resolveCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecResolver

public ExecResolver()
Method Detail

expandCommand

public void expandCommand(Command command,
                          QueryMetadataInterface metadata,
                          AnalysisRecord analysis)
                   throws QueryMetadataException,
                          QueryResolverException,
                          MetaMatrixComponentException
Description copied from class: ProcedureContainerResolver
Expand a command by finding and attaching all subcommands to the command. If some initial resolution must be done for this to be accomplished, that is ok, but it should be kept to a minimum.

Overrides:
expandCommand in class ProcedureContainerResolver
Parameters:
command - The command to expand
metadata - Metadata access
analysis - The analysis record that will be filled in if doing annotation.
Throws:
QueryMetadataException - If there is a metadata problem
QueryResolverException - If the query cannot be resolved
MetaMatrixComponentException - If there is an internal error
See Also:
In this method - retrieve the parameter metadata information for the stored procedure, validate that it matches up with the actual parameters entered by the user, and replace the parsed expressions with the ones retrieved from metadata (except retain the user's parameter values). The user may have used the more common indexed parameters syntax, or may have used named parameters syntax. Named parameters are a little more tricky, because the user is free to enter the parameters in any order and even to leave off optional parameters and/or parameters with default values.

findChildCommandMetadata

public GroupContext findChildCommandMetadata(Command command,
                                             TempMetadataStore childMetadata,
                                             boolean useMetadataCommands,
                                             QueryMetadataInterface metadata)
                                      throws QueryMetadataException,
                                             QueryResolverException,
                                             MetaMatrixComponentException
Description copied from class: ProcedureContainerResolver
Find all metadata defined by this command for it's children. This metadata should be collected in the childMetadata object. Typical uses of this are for stored queries that define parameter variables valid in subcommands. only used for inserts, updates, and deletes

Overrides:
findChildCommandMetadata in class ProcedureContainerResolver
Parameters:
command - The command to find metadata on
useMetadataCommands - True if resolver should use metadata commands to completely resolve
metadata - Metadata access
Throws:
QueryMetadataException - If there is a metadata problem
QueryResolverException - If the query cannot be resolved
MetaMatrixComponentException - If there is an internal error
See Also:
com.metamatrix.query.resolver.CommandResolver#findChildCommandMetadata(com.metamatrix.query.sql.lang. Command, com.metamatrix.query.metadata.QueryMetadataInterface)

resolveProceduralCommand

public void resolveProceduralCommand(Command command,
                                     boolean useMetadataCommands,
                                     TempMetadataAdapter metadata,
                                     AnalysisRecord analysis)
                              throws QueryMetadataException,
                                     QueryResolverException,
                                     MetaMatrixComponentException
Specified by:
resolveProceduralCommand in class ProcedureContainerResolver
Throws:
QueryMetadataException
QueryResolverException
MetaMatrixComponentException
See Also:
ProcedureContainerResolver.resolveProceduralCommand(com.metamatrix.query.sql.lang.Command, boolean, com.metamatrix.query.metadata.TempMetadataAdapter, com.metamatrix.query.analysis.AnalysisRecord)

resolveGroup

protected void resolveGroup(TempMetadataAdapter metadata,
                            ProcedureContainer procCommand)
                     throws MetaMatrixComponentException,
                            QueryResolverException
Overrides:
resolveGroup in class ProcedureContainerResolver
Throws:
MetaMatrixComponentException
QueryResolverException

getVariableValues

public java.util.Map getVariableValues(Command command,
                                       QueryMetadataInterface metadata)
Collect input expressions from a procedure and map them to the parameters they came from

Specified by:
getVariableValues in interface VariableResolver
Parameters:
command - Procedure to collect input expressions from
Returns:
Map of param name (full upper case) to Expression

getPlan

protected java.lang.String getPlan(QueryMetadataInterface metadata,
                                   GroupSymbol group)
                            throws MetaMatrixComponentException,
                                   QueryMetadataException
Description copied from class: ProcedureContainerResolver
For a given resolver, this returns the unparsed command.

Specified by:
getPlan in class ProcedureContainerResolver
Returns:
Throws:
MetaMatrixComponentException
QueryMetadataException
See Also:
ProcedureContainerResolver.getPlan(com.metamatrix.query.metadata.QueryMetadataInterface, com.metamatrix.query.sql.symbol.GroupSymbol)


Copyright © 2009. All Rights Reserved.