org.makumba.providers.query.mql
Class MqlQueryAnalysisProvider

java.lang.Object
  extended by org.makumba.providers.QueryAnalysisProvider
      extended by org.makumba.providers.query.mql.MqlQueryAnalysisProvider

public class MqlQueryAnalysisProvider
extends QueryAnalysisProvider


Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.providers.QueryAnalysisProvider
QueryAnalysisProvider.ASTTransformVisitor, QueryAnalysisProvider.FromWhere
 
Field Summary
static int parsedQueries
           
 
Fields inherited from class org.makumba.providers.QueryAnalysisProvider
DUMMY_PROJECTION, patternInSet, regExpInSET
 
Constructor Summary
MqlQueryAnalysisProvider()
           
 
Method Summary
 FieldDefinition getAlternativeField(DataDefinition dd, String fn)
          Returns a possible alternative field to the one indicated.
 String getName()
           
 String getParameterSyntax()
          return the first character(s) in a parameter designator
 String getPrimaryKeyNotation(String label)
          Returns the notation of the primary key in the query language
 QueryAnalysis getQueryAnalysis(antlr.collections.AST pass1, DataDefinition knownLabels)
           
 QueryAnalysis getRawQueryAnalysis(String query)
           
 QueryAnalysis getRawQueryAnalysis(String query, String insertIn)
           
 boolean selectGroupOrOrderAsLabels()
          Returns whether the GROUP BY or ORDER BY sections can include labels
static void transformOQL(antlr.collections.AST a)
          Transform the tree so that various OQL notations are still accepted replacement of = or <> NIL with IS (NOT) NULL OQL puts a 0.0+ in front of any AVG() expression This method also does various subquery transformations which are not OQL-specific, to support: size(), elements(), firstElement()...
static void transformOQLParameters(antlr.collections.AST a, List<String> parameterOrder)
          Transform OQL $x into :parameters, and record the parameter order
 
Methods inherited from class org.makumba.providers.QueryAnalysisProvider
checkExprSetOrNullable, checkForFrom, checkLabelSetOrNullable, compare, doThrow, getGeneratedActorName, getQueryAnalysis, getQueryAnalysis, inlineFunctions, makeASTCopy, parseQuery, preProcess, reduceDummyFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parsedQueries

public static int parsedQueries
Constructor Detail

MqlQueryAnalysisProvider

public MqlQueryAnalysisProvider()
Method Detail

getName

public String getName()
Specified by:
getName in class QueryAnalysisProvider

getRawQueryAnalysis

public QueryAnalysis getRawQueryAnalysis(String query)
Specified by:
getRawQueryAnalysis in class QueryAnalysisProvider

getRawQueryAnalysis

public QueryAnalysis getRawQueryAnalysis(String query,
                                         String insertIn)
Overrides:
getRawQueryAnalysis in class QueryAnalysisProvider

selectGroupOrOrderAsLabels

public boolean selectGroupOrOrderAsLabels()
Description copied from class: QueryAnalysisProvider
Returns whether the GROUP BY or ORDER BY sections can include labels

Specified by:
selectGroupOrOrderAsLabels in class QueryAnalysisProvider

getAlternativeField

public FieldDefinition getAlternativeField(DataDefinition dd,
                                           String fn)
Description copied from class: QueryAnalysisProvider
Returns a possible alternative field to the one indicated.

Specified by:
getAlternativeField in class QueryAnalysisProvider

getPrimaryKeyNotation

public String getPrimaryKeyNotation(String label)
Description copied from class: QueryAnalysisProvider
Returns the notation of the primary key in the query language

Specified by:
getPrimaryKeyNotation in class QueryAnalysisProvider
Parameters:
label - the label of the object
Returns:
the notation for the primary key of the object

getParameterSyntax

public String getParameterSyntax()
Description copied from class: QueryAnalysisProvider
return the first character(s) in a parameter designator

Specified by:
getParameterSyntax in class QueryAnalysisProvider

transformOQLParameters

public static void transformOQLParameters(antlr.collections.AST a,
                                          List<String> parameterOrder)
Transform OQL $x into :parameters, and record the parameter order


transformOQL

public static void transformOQL(antlr.collections.AST a)
Transform the tree so that various OQL notations are still accepted replacement of = or <> NIL with IS (NOT) NULL OQL puts a 0.0+ in front of any AVG() expression This method also does various subquery transformations which are not OQL-specific, to support: size(), elements(), firstElement()...


getQueryAnalysis

public QueryAnalysis getQueryAnalysis(antlr.collections.AST pass1,
                                      DataDefinition knownLabels)
Specified by:
getQueryAnalysis in class QueryAnalysisProvider