com.metamatrix.query.resolver
Class ProcedureContainerResolver

java.lang.Object
  extended by com.metamatrix.query.resolver.ProcedureContainerResolver
All Implemented Interfaces:
CommandResolver
Direct Known Subclasses:
DeleteResolver, ExecResolver, InsertResolver, UpdateResolver

public abstract class ProcedureContainerResolver
extends java.lang.Object
implements CommandResolver


Constructor Summary
ProcedureContainerResolver()
           
 
Method Summary
static GroupSymbol addScalarGroup(java.lang.String name, TempMetadataStore metadata, GroupContext externalGroups, java.util.List symbols)
           
 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 discoveredMetadata, boolean useMetadataCommands, QueryMetadataInterface metadata)
          Find all metadata defined by this command for it's children.
protected abstract  java.lang.String getPlan(QueryMetadataInterface metadata, GroupSymbol group)
          For a given resolver, this returns the unparsed command.
 void resolveCommand(Command command, boolean useMetadataCommands, TempMetadataAdapter metadata, AnalysisRecord analysis, boolean resolveNullLiterals)
          Resolve the command using the metadata.
protected  void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand)
           
abstract  void resolveProceduralCommand(Command command, boolean useMetadataCommands, TempMetadataAdapter metadata, AnalysisRecord analysis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcedureContainerResolver

public ProcedureContainerResolver()
Method Detail

resolveProceduralCommand

public abstract void resolveProceduralCommand(Command command,
                                              boolean useMetadataCommands,
                                              TempMetadataAdapter metadata,
                                              AnalysisRecord analysis)
                                       throws QueryMetadataException,
                                              QueryResolverException,
                                              MetaMatrixComponentException
Throws:
QueryMetadataException
QueryResolverException
MetaMatrixComponentException

expandCommand

public void expandCommand(Command command,
                          QueryMetadataInterface metadata,
                          AnalysisRecord analysis)
                   throws QueryMetadataException,
                          QueryResolverException,
                          MetaMatrixComponentException
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.

Parameters:
command - The command to expand
useMetadataCommands - True if resolver should use metadata commands to completely resolve
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

getPlan

protected abstract java.lang.String getPlan(QueryMetadataInterface metadata,
                                            GroupSymbol group)
                                     throws MetaMatrixComponentException,
                                            QueryMetadataException
For a given resolver, this returns the unparsed command.

Parameters:
metadata -
group -
Returns:
Throws:
MetaMatrixComponentException
QueryMetadataException

findChildCommandMetadata

public GroupContext findChildCommandMetadata(Command command,
                                             TempMetadataStore discoveredMetadata,
                                             boolean useMetadataCommands,
                                             QueryMetadataInterface metadata)
                                      throws QueryMetadataException,
                                             QueryResolverException,
                                             MetaMatrixComponentException
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

Parameters:
command - The command to find metadata on
childMetadata - The store to collect child metadata in
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

resolveCommand

public void resolveCommand(Command command,
                           boolean useMetadataCommands,
                           TempMetadataAdapter metadata,
                           AnalysisRecord analysis,
                           boolean resolveNullLiterals)
                    throws QueryMetadataException,
                           QueryResolverException,
                           MetaMatrixComponentException
Description copied from interface: CommandResolver
Resolve the command using the metadata.

Specified by:
resolveCommand in interface CommandResolver
Parameters:
command - The command to resolve
useMetadataCommands - true if the resolver should use metadata commands to completely resolve
metadata - Metadata
resolveNullLiterals - true if the resolver should consider replacing null literals with more appropriate types
Throws:
QueryMetadataException - If there is a metadata problem
QueryResolverException - If the query cannot be resolved
MetaMatrixComponentException - If there is an internal error
See Also:
CommandResolver.resolveCommand(com.metamatrix.query.sql.lang.Command, boolean, com.metamatrix.query.metadata.TempMetadataAdapter, com.metamatrix.query.analysis.AnalysisRecord, boolean)

resolveGroup

protected void resolveGroup(TempMetadataAdapter metadata,
                            ProcedureContainer procCommand)
                     throws MetaMatrixComponentException,
                            QueryResolverException
Parameters:
metadata -
procCommand -
Throws:
MetaMatrixComponentException
QueryResolverException

addScalarGroup

public static GroupSymbol addScalarGroup(java.lang.String name,
                                         TempMetadataStore metadata,
                                         GroupContext externalGroups,
                                         java.util.List symbols)


Copyright © 2009. All Rights Reserved.