Class SelectStatementBuilder
- java.lang.Object
-
- com.tangosol.coherence.dslquery.statement.AbstractStatementBuilder<SelectStatementBuilder.SelectStatement>
-
- com.tangosol.coherence.dslquery.statement.SelectStatementBuilder
-
- All Implemented Interfaces:
StatementBuilder<SelectStatementBuilder.SelectStatement>
public class SelectStatementBuilder extends AbstractStatementBuilder<SelectStatementBuilder.SelectStatement>
An implementation of aStatementBuilder
that parses a CohQL term tree to produce an instance of aSelectStatementBuilder.SelectStatement
.- Since:
- Coherence 12.2.1
- Author:
- jk 2013.12.17
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SelectStatementBuilder.AsyncSelectStatement
Async implementation of the CohQL "SELECT" command.static class
SelectStatementBuilder.SelectStatement
Implementation of the CohQL "SELECT" command.
-
Field Summary
Fields Modifier and Type Field Description static SelectStatementBuilder
INSTANCE
An instance of a SelectStatementBuilder.
-
Constructor Summary
Constructors Constructor Description SelectStatementBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InvocableMap.EntryAggregator
createAggregator(String cacheName, NodeTerm fields, String alias, boolean fDistinct, com.tangosol.coherence.dslquery.internal.SelectListMaker transformer)
Create theInvocableMap.EntryAggregator
that will aggregate the results of this select query.protected com.tangosol.coherence.dslquery.internal.SelectListMaker
createSelectListMaker(List listBindVars, ParameterResolver namedBindVars, CoherenceQueryLanguage language)
Create an instance of aSelectListMaker
.String
getDescription()
Return a description of the CohQL command suitable for displaying as help text.String
getSyntax()
Return the syntax of the CohQL command.protected boolean
isSelectStarQuery(String sAlias, NodeTerm termFields)
Return true if this query is of the form "SELECT * FROM cache-name".SelectStatementBuilder.SelectStatement
realize(ExecutionContext ctx, NodeTerm term, List listBindVars, ParameterResolver namedBindVars)
Realizes an implementation of aStatement
that can be executed to perform a specific CohQL command.-
Methods inherited from class com.tangosol.coherence.dslquery.statement.AbstractStatementBuilder
atomicStringValueOf, ensureFilter, getAlias, getCacheName, getExtractor, getFields, getFile, getGroupBy, getInsertKey, getInsertValue, getIsDistinct, getSetList, getWhere, headsMatch
-
-
-
-
Field Detail
-
INSTANCE
public static final SelectStatementBuilder INSTANCE
An instance of a SelectStatementBuilder.
-
-
Method Detail
-
realize
public SelectStatementBuilder.SelectStatement realize(ExecutionContext ctx, NodeTerm term, List listBindVars, ParameterResolver namedBindVars)
Description copied from interface:StatementBuilder
Realizes an implementation of aStatement
that can be executed to perform a specific CohQL command.- Parameters:
ctx
- theExecutionContext
to use to create commandsterm
- the parsedNodeTerm
used to create the relevant StatementlistBindVars
- the indexed bind variablesnamedBindVars
- the named bind variables- Returns:
- an executable instance of a Statement
-
getSyntax
public String getSyntax()
Description copied from interface:StatementBuilder
Return the syntax of the CohQL command.- Returns:
- the syntax of the CohQL command
-
getDescription
public String getDescription()
Description copied from interface:StatementBuilder
Return a description of the CohQL command suitable for displaying as help text.- Returns:
- a description of the CohQL command suitable for displaying as help text
-
createAggregator
protected InvocableMap.EntryAggregator createAggregator(String cacheName, NodeTerm fields, String alias, boolean fDistinct, com.tangosol.coherence.dslquery.internal.SelectListMaker transformer)
Create theInvocableMap.EntryAggregator
that will aggregate the results of this select query.- Parameters:
cacheName
- the cache being queriedfields
- the fields being selectedalias
- the alias of the cache namefDistinct
- a flag indicating whether this is a distinct querytransformer
- the transformer to use to transform the field list to extractors- Returns:
- an InvocableMap.EntryAggregator to use to aggregate the query results.
-
createSelectListMaker
protected com.tangosol.coherence.dslquery.internal.SelectListMaker createSelectListMaker(List listBindVars, ParameterResolver namedBindVars, CoherenceQueryLanguage language)
Create an instance of aSelectListMaker
.- Parameters:
listBindVars
- the indexed bind variables that the SelectListMaker should usenamedBindVars
- the named bind variables that the SelectListMaker should uselanguage
- the CohQL language instance that the SelectListMaker should use- Returns:
- a SelectListMaker
-
isSelectStarQuery
protected boolean isSelectStarQuery(String sAlias, NodeTerm termFields)
Return true if this query is of the form "SELECT * FROM cache-name".- Parameters:
sAlias
- the alias for the cache nametermFields
- the field list for the query- Returns:
- true if this is a "SELECT * FROM cache-name" query
-
-