|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.providers.QueryAnalysisProvider
public abstract class QueryAnalysisProvider
Nested Class Summary | |
---|---|
static class |
QueryAnalysisProvider.ASTTransformVisitor
|
static class |
QueryAnalysisProvider.FromWhere
A holder for FROM and WHERE sections to enrich a query, and the query enrichment code. |
(package private) static class |
QueryAnalysisProvider.SubqueryReductionVisitor
|
Field Summary | |
---|---|
static String |
DUMMY_PROJECTION
|
static Pattern |
patternInSet
|
static String |
regExpInSET
|
Constructor Summary | |
---|---|
QueryAnalysisProvider()
|
Method Summary | |
---|---|
Object |
checkExprSetOrNullable(String from,
String expr)
Checks if an expression is valid, nullable or set |
static String |
checkForFrom(String query)
Add a dummy FROM section to the query if it doesn't have one, in order for it to conform to the grammars. |
Object |
checkLabelSetOrNullable(String from,
String referenceSequence)
Checks if an id is nullable, and if so, return the path to the null pointer |
static boolean |
compare(List<antlr.collections.AST> path,
antlr.collections.AST t1,
antlr.collections.AST t2)
Test method to compare two AST trees |
static void |
doThrow(String query,
Throwable t,
antlr.collections.AST debugTree)
|
abstract FieldDefinition |
getAlternativeField(DataDefinition dd,
String fn)
Returns a possible alternative field to the one indicated. |
static String |
getGeneratedActorName(antlr.collections.AST actorType)
|
abstract String |
getName()
|
abstract String |
getParameterSyntax()
return the first character(s) in a parameter designator |
abstract String |
getPrimaryKeyNotation(String label)
Returns the notation of the primary key in the query language |
abstract QueryAnalysis |
getQueryAnalysis(antlr.collections.AST query,
DataDefinition knownLabels)
|
QueryAnalysis |
getQueryAnalysis(String query)
|
QueryAnalysis |
getQueryAnalysis(String query,
String insertIn)
|
protected abstract QueryAnalysis |
getRawQueryAnalysis(String query)
|
protected QueryAnalysis |
getRawQueryAnalysis(String query,
String insertIn)
|
antlr.collections.AST |
inlineFunctions(String query)
|
(package private) static boolean |
isMakId(char c)
Checks if a character can be part of a makumba identifier |
static antlr.collections.AST |
makeASTCopy(antlr.collections.AST current1)
make a copy of an AST, node with the same first child, but with no next sibling |
static antlr.collections.AST |
parseQuery(String query)
|
static String |
preProcess(String query)
|
static boolean |
reduceDummyFrom(antlr.collections.AST parsed)
Attempt to reduce the dummy FROM from the AST after inlining. |
abstract boolean |
selectGroupOrOrderAsLabels()
Returns whether the GROUP BY or ORDER BY sections can include labels |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DUMMY_PROJECTION
public static final String regExpInSET
public static final Pattern patternInSet
Constructor Detail |
---|
public QueryAnalysisProvider()
Method Detail |
---|
public abstract String getName()
protected abstract QueryAnalysis getRawQueryAnalysis(String query)
protected QueryAnalysis getRawQueryAnalysis(String query, String insertIn)
public QueryAnalysis getQueryAnalysis(String query)
public abstract QueryAnalysis getQueryAnalysis(antlr.collections.AST query, DataDefinition knownLabels)
public QueryAnalysis getQueryAnalysis(String query, String insertIn)
public abstract boolean selectGroupOrOrderAsLabels()
public abstract FieldDefinition getAlternativeField(DataDefinition dd, String fn)
public abstract String getPrimaryKeyNotation(String label)
label
- the label of the object
public Object checkExprSetOrNullable(String from, String expr)
expr
- the expression
null
otherwisestatic boolean isMakId(char c)
c
- the character to check
true
if the character can be part of a makumba identifier, false
otherwisepublic Object checkLabelSetOrNullable(String from, String referenceSequence)
referenceSequence
- a sequence like field1.field2.field3
null
otherwisepublic abstract String getParameterSyntax()
public static String getGeneratedActorName(antlr.collections.AST actorType)
public antlr.collections.AST inlineFunctions(String query)
public static antlr.collections.AST makeASTCopy(antlr.collections.AST current1)
public static boolean compare(List<antlr.collections.AST> path, antlr.collections.AST t1, antlr.collections.AST t2)
path
- the path from the root to the compared nodest1
- current node in the first treet2
- current node in second tree
public static void doThrow(String query, Throwable t, antlr.collections.AST debugTree)
public static antlr.collections.AST parseQuery(String query)
public static String checkForFrom(String query)
query
-
public static boolean reduceDummyFrom(antlr.collections.AST parsed)
parsed
- the AST
public static String preProcess(String query)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |