org.teiid.query.resolver
Class QueryResolver

java.lang.Object
  extended by org.teiid.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 Command expandCommand(ProcedureContainer proc, QueryMetadataInterface metadata, AnalysisRecord analysisRecord)
           
static java.util.Map getVariableValues(Command command, QueryMetadataInterface metadata)
           
static boolean isXMLQuery(Query query, QueryMetadataInterface metadata)
          Check to verify if the query would return XML results.
static TempMetadataStore resolveCommand(Command currentCommand, java.util.Map externalMetadata, 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, 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 resolveSubqueries(Command command, TempMetadataAdapter metadata, AnalysisRecord analysis)
           
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

expandCommand

public static Command expandCommand(ProcedureContainer proc,
                                    QueryMetadataInterface metadata,
                                    AnalysisRecord analysisRecord)
                             throws QueryResolverException,
                                    QueryMetadataException,
                                    TeiidComponentException
Throws:
QueryResolverException
QueryMetadataException
TeiidComponentException

resolveCommand

public static void resolveCommand(Command command,
                                  QueryMetadataInterface metadata,
                                  AnalysisRecord analysis)
                           throws QueryResolverException,
                                  TeiidComponentException
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
TeiidComponentException

resolveCommand

public static void resolveCommand(Command command,
                                  QueryMetadataInterface metadata)
                           throws QueryResolverException,
                                  TeiidComponentException
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
TeiidComponentException

resolveCommand

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

Parameters:
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
metadata - QueryMetadataInterface the metadata
analysis - The analysis record which can be used to add anotations and debug information.
command - Command the SQL command we are running (Select, Update, Insert, Delete)
Throws:
QueryResolverException
TeiidComponentException

resolveCommand

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

isXMLQuery

public static boolean isXMLQuery(Query query,
                                 QueryMetadataInterface metadata)
                          throws TeiidComponentException,
                                 QueryMetadataException,
                                 QueryResolverException
Check to verify if the query would return XML results.

Parameters:
query - the query to check
metadata - QueryMetadataInterface the metadata
Throws:
TeiidComponentException
QueryMetadataException
QueryResolverException

resolveCriteria

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

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

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,
                                              TeiidComponentException
Throws:
QueryMetadataException
QueryResolverException
TeiidComponentException

resolveSubqueries

public static void resolveSubqueries(Command command,
                                     TempMetadataAdapter metadata,
                                     AnalysisRecord analysis)
                              throws QueryResolverException,
                                     TeiidComponentException
Throws:
QueryResolverException
TeiidComponentException


Copyright © 2010. All Rights Reserved.