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 for StatementBuilder implementations.
Since:
Coherence 12.2.1
Author:
jk 2013.12.09
  • Constructor Details

    • AbstractStatementBuilder

      public AbstractStatementBuilder()
  • Method Details

    • ensureFilter

      protected static Filter ensureFilter(NodeTerm termWhere, String sCacheName, String sAlias, List listBindVars, ParameterResolver namedBindVars, ExecutionContext ctx)
      Build a Filter for the given cache using the given where clause, alias and bind environments.
      Parameters:
      termWhere - the NodeTerm containing the where clause
      sCacheName - the name of the cache that the filter will be built for
      sAlias - the table/cache alias used in the where clause, may be null
      listBindVars - bind variables to be used to replace any numeric bind variables in the where clause
      namedBindVars - named bind variables to be used to replace any named bind variables in the where clause
      ctx - the ExecutionContext 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 list
      groupByList - the list of fields in a group by clause
      Returns:
      return the results of matching