Class AbstractStatementBuilder<T extends Statement>
- java.lang.Object
-
- com.tangosol.coherence.dslquery.statement.AbstractStatementBuilder<T>
-
- All Implemented Interfaces:
StatementBuilder<T>
- Direct Known Subclasses:
ArchiveSnapshotStatementBuilder
,BackupStatementBuilder
,CreateCacheStatementBuilder
,CreateIndexStatementBuilder
,CreateSnapshotStatementBuilder
,DeleteStatementBuilder
,DropCacheStatementBuilder
,DropIndexStatementBuilder
,ForceRecoveryStatementBuilder
,InsertStatementBuilder
,ListArchiverStatementBuilder
,ListServicesStatementBuilder
,ListSnapshotsStatementBuilder
,QueryRecorderStatementBuilder
,RecoverSnapshotStatementBuilder
,RemoveSnapshotStatementBuilder
,RestoreStatementBuilder
,ResumeServiceStatementBuilder
,RetrieveSnapshotStatementBuilder
,SelectStatementBuilder
,SourceStatementBuilder
,SuspendServiceStatementBuilder
,TruncateCacheStatementBuilder
,UpdateStatementBuilder
,ValidateSnapshotStatementBuilder
public abstract class AbstractStatementBuilder<T extends Statement> extends Object implements StatementBuilder<T>
A base class forStatementBuilder
implementations.- Since:
- Coherence 12.2.1
- Author:
- jk 2013.12.09
-
-
Constructor Summary
Constructors Constructor Description AbstractStatementBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
atomicStringValueOf(Term t)
Return a String that is the value of the given Term.protected static Filter
ensureFilter(NodeTerm termWhere, String sCacheName, String sAlias, List listBindVars, ParameterResolver namedBindVars, ExecutionContext ctx)
Build aFilter
for the given cache using the given where clause, alias and bind environments.protected static String
getAlias(NodeTerm sn)
Return the String that represents the cache name alias from the given AST node by looking for the "alias" term in the AST.protected static String
getCacheName(NodeTerm sn)
Return the String that represents the cache name from the given AST node by looking for the "from" term AST.protected static Term
getExtractor(NodeTerm sn)
Return the AST node that represents the extractor for an index from the given AST node.protected static NodeTerm
getFields(NodeTerm sn)
Return the AST node that represents the fields to select from the given AST node.protected static String
getFile(NodeTerm sn)
Return the String that represents the filename from the given AST node by looking for the "file" term in the AST.protected static NodeTerm
getGroupBy(NodeTerm sn)
Return the AST node that represents the group by fields from the given AST node.protected static Term
getInsertKey(NodeTerm sn)
Return the AST node that represents the key to insert from the given AST node.protected static Term
getInsertValue(NodeTerm sn)
Return the AST node that represents the value to insert from the given AST node.protected static boolean
getIsDistinct(NodeTerm sn)
Return the boolean that indicates whether distinctness in indicated in the given AST node.protected static Term
getSetList(NodeTerm sn)
Return the AST node that represents the list of "Set statements" from the given AST node.protected static NodeTerm
getWhere(NodeTerm sn)
Return the AST node that represents the where clause from the given AST node.protected static boolean
headsMatch(NodeTerm fieldList, NodeTerm groupByList)
Test to see if the AST for the group-by is equal to the head of the list from the select clause AST.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.dslquery.StatementBuilder
getDescription, getSyntax, realize
-
-
-
-
Method Detail
-
ensureFilter
protected static Filter ensureFilter(NodeTerm termWhere, String sCacheName, String sAlias, List listBindVars, ParameterResolver namedBindVars, ExecutionContext ctx)
Build aFilter
for the given cache using the given where clause, alias and bind environments.- Parameters:
termWhere
- theNodeTerm
containing the where clausesCacheName
- the name of the cache that the filter will be built forsAlias
- the table/cache alias used in the where clause, may be nulllistBindVars
- bind variables to be used to replace any numeric bind variables in the where clausenamedBindVars
- named bind variables to be used to replace any named bind variables in the where clausectx
- theExecutionContext
to use- Returns:
- a
Filter
created from the given where clause
-
atomicStringValueOf
protected static String atomicStringValueOf(Term t)
Return a String that is the value of the given Term.- Parameters:
t
- the Term that is atomic- Returns:
- return the String found in the AtomicTerm
-
getCacheName
protected static String getCacheName(NodeTerm sn)
Return the String that represents the cache name from the given AST node by looking for the "from" term AST.- Parameters:
sn
- the syntax node- Returns:
- return the String found in the AST node
-
getAlias
protected static String getAlias(NodeTerm sn)
Return the String that represents the cache name alias from the given AST node by looking for the "alias" term in the AST.- Parameters:
sn
- the syntax node- Returns:
- return the String found in the AST node
-
getFile
protected static String getFile(NodeTerm sn)
Return the String that represents the filename from the given AST node by looking for the "file" term in the AST.- Parameters:
sn
- the syntax node- Returns:
- return the String found in the AST node
-
getIsDistinct
protected static boolean getIsDistinct(NodeTerm sn)
Return the boolean that indicates whether distinctness in indicated in the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the boolean result of testing the node
-
getWhere
protected static NodeTerm getWhere(NodeTerm sn)
Return the AST node that represents the where clause from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getFields
protected static NodeTerm getFields(NodeTerm sn)
Return the AST node that represents the fields to select from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getInsertKey
protected static Term getInsertKey(NodeTerm sn)
Return the AST node that represents the key to insert from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getInsertValue
protected static Term getInsertValue(NodeTerm sn)
Return the AST node that represents the value to insert from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getGroupBy
protected static NodeTerm getGroupBy(NodeTerm sn)
Return the AST node that represents the group by fields from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getSetList
protected static Term getSetList(NodeTerm sn)
Return the AST node that represents the list of "Set statements" from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
getExtractor
protected static Term getExtractor(NodeTerm sn)
Return the AST node that represents the extractor for an index from the given AST node.- Parameters:
sn
- the syntax node- Returns:
- return the AST node found in the parent AST node
-
headsMatch
protected static boolean headsMatch(NodeTerm fieldList, NodeTerm groupByList)
Test to see if the AST for the group-by is equal to the head of the list from the select clause AST.- Parameters:
fieldList
- the list of fields in a select listgroupByList
- the list of fields in a group by clause- Returns:
- return the results of matching
-
-