public abstract class AbstractDMLQuery extends Object implements Query, Cloneable
Modifier and Type | Field and Description |
---|---|
protected boolean |
_buildOnly |
protected boolean |
_containsQuery |
protected boolean |
_convertResultToArray |
protected IQueryExecutor |
_executor |
protected OperationID |
_operationID |
protected AbstractProjectionTemplate |
_projectionTemplate |
protected QueryResultTypeInternal |
_queryResultType |
protected List<QueryTableData> |
_tablesData |
protected ExpNode |
expTree |
protected boolean |
isPrepared |
protected Object[] |
preparedValues |
protected List |
queryColumns |
protected RowNumNode |
rownum |
protected SecurityInterceptor |
securityInterceptor |
protected ConcurrentHashMap<String,QueryTableData> |
tables |
protected TreeMap<String,Object> |
valueMap |
Constructor and Description |
---|
AbstractDMLQuery() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(String column)
Add a column to the list of columns.
|
QueryTableData |
addTableWithAlias(String table,
String alias) |
void |
assignParameters(SQLQuery<?> sqlQuery,
IDirectSpaceProxy proxy) |
void |
build()
Build query internal structures - called after parsing
|
void |
buildTemplates()
Convert the expression tree to space queries in form of IEntryPacket templates
|
abstract AbstractDMLQuery |
clone() |
boolean |
containsSubQueries()
Gets whether this query contains sub queries.
|
BatchResponsePacket |
executePreparedValuesBatch(ISpaceProxy space,
Transaction transaction,
GPreparedStatement.PreparedValuesCollection preparedValuesCollection)
Executes a query with batched prepared values.
|
protected void |
executeSubQueries(ISpaceProxy space,
Transaction txn) |
protected void |
filterByRownum(Collection<IEntryPacket> entries) |
QueryTemplateBuilder |
getBuilder() |
ExplainPlan |
getExplainPlan() |
ExpNode |
getExpTree() |
boolean |
getIfExists() |
int |
getMinEntriesToWaitFor() |
OperationID |
getOperationID() |
Object[] |
getPreparedValues() |
AbstractProjectionTemplate |
getProjectionTemplate() |
SelectColumn |
getQueryColumnByAlias(String alias) |
List<SelectColumn> |
getQueryColumns()
Returns the list of columns in this query as Strings.
|
QueryResultTypeInternal |
getQueryResultType() |
int |
getReadModifier() |
Object |
getRouting()
Gets the routing value of the query.
|
RowNumNode |
getRownum() |
protected int |
getRownumLimit() |
SecurityInterceptor |
getSecurityInterceptor() |
QuerySession |
getSession() |
String |
getTableByAlias(String alias)
Return a table name according to its alias.
|
QueryTableData |
getTableData() |
QueryTableData |
getTableData(String tableName) |
String |
getTableName() |
List<QueryTableData> |
getTablesData() |
String |
getTablesNames() |
QueryTemplatePacket |
getTemplatePacketIfExists() |
long |
getTimeout() |
ITypeDesc |
getTypeInfo() |
boolean |
isBuildOnly() |
boolean |
isContainsQuery() |
boolean |
isConvertResultToArray() |
boolean |
isDirtyState()
Gets whether the query is in dirty state
|
boolean |
isForceUnderTransaction()
Gets whether this query is forced to be executed under transaction.
|
boolean |
isJoined() |
boolean |
isPrepared() |
boolean |
isReturnResult() |
boolean |
isSelectQuery()
Gets whether this query is a SELECT query.
|
void |
prepare(ISpaceProxy space,
Transaction txn)
Set the prepared values on the expression tree
|
protected void |
readExternal(ObjectInput in) |
void |
setBuildOnly(boolean isBuildOnly) |
void |
setContainsQuery(boolean containsQuery) |
void |
setContainsSubQueries(boolean containsSubQueries) |
void |
setConvertResultToArray(boolean convertResultToArray) |
void |
setExplainPlan(ExplainPlan _explainPlan) |
void |
setExpTree(ExpNode rootNode)
Sets the root node of the expression tree.
|
void |
setIfExists(boolean ifExists) |
void |
setMaxResults(int maxResults) |
void |
setMinEntriesToWaitFor(int minEntriesToWaitFor) |
void |
setOperationID(OperationID operationID) |
void |
setPrepared(boolean isPrepared) |
void |
setPreparedValues(Object[] preparedValues) |
void |
setProjectionTemplate(AbstractProjectionTemplate projectionTemplate) |
void |
setQueryResultType(QueryResultTypeInternal queryResultType) |
void |
setReadModifier(int readModifier) |
void |
setReturnResult(boolean returnResult) |
void |
setRouting(Object routing)
Sets the routing value of the query.
|
void |
setRownum(RowNumNode rownum) |
void |
setSecurityInterceptor(SecurityInterceptor securityInterceptor) |
void |
setSession(QuerySession session) |
void |
setTableName(String table)
sets the table name of the query.
|
void |
setTemplatePreparedValues(ITypeDesc typeDesc,
Object[] fieldValues) |
void |
setTimeout(long timeout) |
protected void |
validateBuiltTemplates() |
void |
validateQuery(ISpaceProxy space)
Each query should have its own specific validations.
|
protected void |
writeExternal(ObjectOutput out) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeOnSpace
protected boolean isPrepared
protected List queryColumns
protected ExpNode expTree
protected Object[] preparedValues
protected List<QueryTableData> _tablesData
protected RowNumNode rownum
protected ConcurrentHashMap<String,QueryTableData> tables
protected transient boolean _containsQuery
protected boolean _buildOnly
protected boolean _convertResultToArray
protected IQueryExecutor _executor
protected OperationID _operationID
protected QueryResultTypeInternal _queryResultType
protected SecurityInterceptor securityInterceptor
protected AbstractProjectionTemplate _projectionTemplate
public void build() throws SQLException
build
in interface Query
SQLException
protected void validateBuiltTemplates() throws SQLException
SQLException
public boolean isContainsQuery()
public void setContainsQuery(boolean containsQuery)
public int getReadModifier()
public void setReadModifier(int readModifier)
readModifier
- the readModifier to setpublic void setPrepared(boolean isPrepared)
isPrepared
- is this a PreparedStatment or not.public boolean isPrepared()
isPrepared
in interface Query
public List<SelectColumn> getQueryColumns()
public SelectColumn getQueryColumnByAlias(String alias)
public void addColumn(String column)
column
- the column to addpublic void setTableName(String table)
public String getTableName()
public void setExpTree(ExpNode rootNode)
public ExpNode getExpTree()
public boolean isJoined()
public abstract AbstractDMLQuery clone()
public void setRownum(RowNumNode rownum)
public RowNumNode getRownum()
public Object[] getPreparedValues()
public void setPreparedValues(Object[] preparedValues)
public QuerySession getSession()
public void setSession(QuerySession session)
setSession
in interface Query
public void setTemplatePreparedValues(ITypeDesc typeDesc, Object[] fieldValues)
public QueryTableData addTableWithAlias(String table, String alias)
public String getTableByAlias(String alias)
public boolean isBuildOnly()
public void setBuildOnly(boolean isBuildOnly)
public boolean isConvertResultToArray()
public void setConvertResultToArray(boolean convertResultToArray)
convertResultToArray
- public void buildTemplates() throws SQLException
SQLException
public QueryTemplatePacket getTemplatePacketIfExists()
public ITypeDesc getTypeInfo()
public void prepare(ISpaceProxy space, Transaction txn) throws SQLException
SQLException
protected void executeSubQueries(ISpaceProxy space, Transaction txn) throws SQLException
SQLException
public boolean isReturnResult()
public void setReturnResult(boolean returnResult)
protected int getRownumLimit()
protected void filterByRownum(Collection<IEntryPacket> entries)
public OperationID getOperationID()
public void setOperationID(OperationID operationID)
operationID
- the operationID to setpublic QueryResultTypeInternal getQueryResultType()
public void setQueryResultType(QueryResultTypeInternal queryResultType)
public void setSecurityInterceptor(SecurityInterceptor securityInterceptor)
setSecurityInterceptor
in interface Query
public SecurityInterceptor getSecurityInterceptor()
public List<QueryTableData> getTablesData()
public String getTablesNames()
public QueryTableData getTableData(String tableName)
public QueryTableData getTableData()
public void validateQuery(ISpaceProxy space) throws SQLException
Query
validateQuery
in interface Query
SQLException
public QueryTemplateBuilder getBuilder()
public long getTimeout()
public void setTimeout(long timeout)
public boolean getIfExists()
public void setIfExists(boolean ifExists)
public void setRouting(Object routing)
public Object getRouting()
public void setProjectionTemplate(AbstractProjectionTemplate projectionTemplate)
public AbstractProjectionTemplate getProjectionTemplate()
public boolean isDirtyState()
public boolean isSelectQuery()
public boolean isForceUnderTransaction()
isForceUnderTransaction
in interface Query
public boolean containsSubQueries()
Query
containsSubQueries
in interface Query
public void setContainsSubQueries(boolean containsSubQueries)
public BatchResponsePacket executePreparedValuesBatch(ISpaceProxy space, Transaction transaction, GPreparedStatement.PreparedValuesCollection preparedValuesCollection) throws SQLException
SQLException
public void setMaxResults(int maxResults)
public void setMinEntriesToWaitFor(int minEntriesToWaitFor)
public int getMinEntriesToWaitFor()
public void assignParameters(SQLQuery<?> sqlQuery, IDirectSpaceProxy proxy)
public ExplainPlan getExplainPlan()
public void setExplainPlan(ExplainPlan _explainPlan)
protected void writeExternal(ObjectOutput out) throws IOException
IOException
protected void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Copyright © GigaSpaces.