com.metamatrix.query.resolver
Class QueryResolver

java.lang.Object
  extended by com.metamatrix.query.resolver.QueryResolver

public class QueryResolver
extends java.lang.Object

The QueryResolver is used between Parsing and QueryValidation. The SQL queries, inserts, updates and deletes are parsed and converted into objects. The language objects have variable names which resolved to fully qualified names using metadata information. The resolver is also used in transforming the values in language objects to their variable types defined in metadata.


Constructor Summary
QueryResolver()
           
 
Method Summary
static java.util.Map getVariableValues(Command command, QueryMetadataInterface metadata)
           
static TempMetadataStore resolveCommand(Command currentCommand, java.util.Map externalMetadata, boolean useMetadataCommands, QueryMetadataInterface metadata, AnalysisRecord analysis)
          This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs
static TempMetadataStore resolveCommand(Command currentCommand, java.util.Map externalMetadata, boolean useMetadataCommands, QueryMetadataInterface metadata, AnalysisRecord analysis, boolean resolveNullLiterals)
           
static void resolveCommand(Command command, QueryMetadataInterface metadata)
          This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs
static void resolveCommand(Command command, QueryMetadataInterface metadata, AnalysisRecord analysis)
          This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs
static void resolveCriteria(Criteria criteria, QueryMetadataInterface metadata)
          Resolve just a criteria.
static void setChildMetadata(Command subCommand, Command parent)
           
static void setChildMetadata(Command subCommand, java.util.Map parentTempMetadata, GroupContext parentContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResolver

public QueryResolver()
Method Detail

resolveCommand

public static void resolveCommand(Command command,
                                  QueryMetadataInterface metadata,
                                  AnalysisRecord analysis)
                           throws QueryResolverException,
                                  MetaMatrixComponentException
This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs

Parameters:
command - Command the SQL command we are running (Select, Update, Insert, Delete)
metadata - QueryMetadataInterface the metadata
analysis - The analysis record which can be used to add anotations and debug information.
Throws:
QueryResolverException
MetaMatrixComponentException

resolveCommand

public static void resolveCommand(Command command,
                                  QueryMetadataInterface metadata)
                           throws QueryResolverException,
                                  MetaMatrixComponentException
This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs

Parameters:
command - Command the SQL command we are running (Select, Update, Insert, Delete)
metadata - QueryMetadataInterface the metadata
Throws:
QueryResolverException
MetaMatrixComponentException

resolveCommand

public static TempMetadataStore resolveCommand(Command currentCommand,
                                               java.util.Map externalMetadata,
                                               boolean useMetadataCommands,
                                               QueryMetadataInterface metadata,
                                               AnalysisRecord analysis)
                                        throws QueryResolverException,
                                               MetaMatrixComponentException
This implements an algorithm to resolve all the symbols created by the parser into real metadata IDs

Parameters:
command - Command the SQL command we are running (Select, Update, Insert, Delete)
externalMetadata - Map of GroupSymbol to a List of ElementSymbol that identifies valid external groups that can be resolved against. Any elements resolved against external groups will be treated as variables
useMetadataCommands - True if resolver should use metadata commands to completely resolve the command tree all the way to physical. False if resolver should resolve only the visible command
metadata - QueryMetadataInterface the metadata
analysis - The analysis record which can be used to add anotations and debug information.
Throws:
QueryResolverException
MetaMatrixComponentException

resolveCommand

public static TempMetadataStore resolveCommand(Command currentCommand,
                                               java.util.Map externalMetadata,
                                               boolean useMetadataCommands,
                                               QueryMetadataInterface metadata,
                                               AnalysisRecord analysis,
                                               boolean resolveNullLiterals)
                                        throws QueryResolverException,
                                               MetaMatrixComponentException
Throws:
QueryResolverException
MetaMatrixComponentException

resolveCriteria

public static void resolveCriteria(Criteria criteria,
                                   QueryMetadataInterface metadata)
                            throws QueryResolverException,
                                   QueryMetadataException,
                                   MetaMatrixComponentException
Resolve just a criteria. The criteria will be modified so nothing is returned.

Parameters:
criteria - Criteria to resolve
metadata - Metadata implementation
Throws:
QueryResolverException
QueryMetadataException
MetaMatrixComponentException

setChildMetadata

public static void setChildMetadata(Command subCommand,
                                    Command parent)

setChildMetadata

public static void setChildMetadata(Command subCommand,
                                    java.util.Map parentTempMetadata,
                                    GroupContext parentContext)

getVariableValues

public static java.util.Map getVariableValues(Command command,
                                              QueryMetadataInterface metadata)
                                       throws QueryMetadataException,
                                              QueryResolverException,
                                              MetaMatrixComponentException
Throws:
QueryMetadataException
QueryResolverException
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.