Class InsertStatementBuilder
- java.lang.Object
-
- com.tangosol.coherence.dslquery.statement.AbstractStatementBuilder<InsertStatementBuilder.InsertStatement>
-
- com.tangosol.coherence.dslquery.statement.InsertStatementBuilder
-
- All Implemented Interfaces:
StatementBuilder<InsertStatementBuilder.InsertStatement>
public class InsertStatementBuilder extends AbstractStatementBuilder<InsertStatementBuilder.InsertStatement>
An implementation of aStatementBuilder
that parses a CohQL term tree to produce an instance of aInsertStatementBuilder.InsertStatement
.- Since:
- Coherence 12.2.1
- Author:
- jk 2013.12.17
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InsertStatementBuilder.InsertStatement
Implementation of the CohQL "INSERT" command.
-
Field Summary
Fields Modifier and Type Field Description static InsertStatementBuilder
INSTANCE
An instance of a InsertStatementBuilder.
-
Constructor Summary
Constructors Constructor Description InsertStatementBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
createInsertKey(Term termKey, com.tangosol.coherence.dslquery.internal.UpdateSetListMaker transformer, Object oValue)
Create the key to use in the insert statement.protected Object
createInsertValue(Term termValue, com.tangosol.coherence.dslquery.internal.UpdateSetListMaker transformer)
Create the instance of the value that will be inserted into the cache.protected com.tangosol.coherence.dslquery.internal.UpdateSetListMaker
createUpdateSetListMaker(ExecutionContext ctx, List listBindVars, ParameterResolver namedBindVars)
Create anUpdateSetListMaker
.String
getDescription()
Return a description of the CohQL command suitable for displaying as help text.String
getSyntax()
Return the syntax of the CohQL command.InsertStatementBuilder.InsertStatement
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 InsertStatementBuilder INSTANCE
An instance of a InsertStatementBuilder.
-
-
Method Detail
-
realize
public InsertStatementBuilder.InsertStatement 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
-
createInsertKey
protected Object createInsertKey(Term termKey, com.tangosol.coherence.dslquery.internal.UpdateSetListMaker transformer, Object oValue)
Create the key to use in the insert statement.- Parameters:
termKey
- the AST representing the Key termtransformer
- theUpdateSetListMaker
that will create the key instanceoValue
- the value being inserted that will be used to call its getKey method if no key term is present- Returns:
- the value to use as the key for the insert
- Throws:
CohQLException
- if there are any errors creating the key instance
-
createInsertValue
protected Object createInsertValue(Term termValue, com.tangosol.coherence.dslquery.internal.UpdateSetListMaker transformer)
Create the instance of the value that will be inserted into the cache.- Parameters:
termValue
- the AST term to use to create the valuetransformer
- theUpdateSetListMaker
that can create values from AST terms- Returns:
- an instance of a value to insert into the cache
- Throws:
CohQLException
- if any errors occur creating the value
-
createUpdateSetListMaker
protected com.tangosol.coherence.dslquery.internal.UpdateSetListMaker createUpdateSetListMaker(ExecutionContext ctx, List listBindVars, ParameterResolver namedBindVars)
Create anUpdateSetListMaker
.- Parameters:
ctx
- theExecutionContext
to uselistBindVars
- the indexed bind variables to pass to the UpdateSetListMakernamedBindVars
- the named bind variables to pass to the UpdateSetListMaker- Returns:
- an UpdateSetListMaker
-
-