Package com.j_spaces.jdbc
Class SelectQuery
java.lang.Object
com.j_spaces.jdbc.AbstractDMLQuery
com.j_spaces.jdbc.SelectQuery
- All Implemented Interfaces:
Query,Externalizable,Serializable,Cloneable
This class handles the SELECT query logic.
- Author:
- Michael Mitrani, 2Train4, 2004
- See Also:
-
Field Summary
FieldsFields inherited from class com.j_spaces.jdbc.AbstractDMLQuery
_buildOnly, _containsQuery, _convertResultToArray, _executor, _operationID, _projectionTemplate, _queryResultType, _tablesData, expTree, isPrepared, preparedValues, queryColumns, rownum, securityInterceptor, tables, valueMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddColumn(SelectColumn column) Add a column to the list of columns.voidaddTableWithAlias(Object table, String alias) clone()Return a cloned SelectQueryexecuteOnSpace(ISpaceProxy space, Transaction txn) Execute the queryexecutePreparedValuesBatch(ISpaceProxy space, Transaction transaction, GPreparedStatement.PreparedValuesCollection preparedValuesCollection) Executes a query with batched prepared values.booleanbooleanbooleanGets whether this query is a SELECT query.voidvoidsetAggFunction(boolean flag) voidsetDistinct(boolean isDistinct) voidsetForUpdate(boolean forUpdate) Mark this select as a SELECT FOR UPDATE.voidsetGroupColumn(ArrayList<SelectColumn> groupColumnList) Sets the order column.voidvoidsetOrderColumns(ArrayList<OrderColumn> ordCol) Sets the order column.voidvalidateQuery(ISpaceProxy space) This method pre-validates the query, in terms of selected tables and columns.voidMethods inherited from class com.j_spaces.jdbc.AbstractDMLQuery
addColumn, addTableWithAlias, assignParameters, build, buildTemplates, containsSubQueries, executeSubQueries, filterByRownum, getBuilder, getExplainPlan, getExpTree, getIfExists, getMinEntriesToWaitFor, getOperationID, getPreparedValues, getProjectionTemplate, getQueryColumnByAlias, getQueryColumns, getQueryResultType, getReadModifier, getRouting, getRownum, getRownumLimit, getSecurityInterceptor, getSession, getTableByAlias, getTableData, getTableData, getTableName, getTablesData, getTablesNames, getTemplatePacketIfExists, getTimeout, getTypeInfo, isBuildOnly, isContainsQuery, isConvertResultToArray, isDirtyState, isForceUnderTransaction, isJoined, isPrepared, isReturnResult, prepare, setBuildOnly, setContainsQuery, setContainsSubQueries, setConvertResultToArray, setExplainPlan, setExpTree, setIfExists, setMaxResults, setMinEntriesToWaitFor, setOperationID, setPrepared, setPreparedValues, setProjectionTemplate, setQueryResultType, setReadModifier, setReturnResult, setRouting, setRownum, setSecurityInterceptor, setSession, setTableName, setTemplatePreparedValues, setTimeout, validateBuiltTemplates, validateQuery
-
Field Details
-
_aggregationSet
-
-
Constructor Details
-
SelectQuery
public SelectQuery()
-
-
Method Details
-
addTableWithAlias
-
setJoins
-
addAbsentCol
public void addAbsentCol() -
setAggFunction
public void setAggFunction(boolean flag) -
isAggFunction
public boolean isAggFunction() -
executeOnSpace
Execute the query- Specified by:
executeOnSpacein interfaceQuery- Throws:
SQLException
-
isCollocatedJoin
public boolean isCollocatedJoin() -
clone
Return a cloned SelectQuery- Specified by:
clonein classAbstractDMLQuery
-
addColumn
Add a column to the list of columns.- Parameters:
column- the column to add
-
setOrderColumns
Sets the order column. -
setGroupColumn
Sets the order column. -
getGroupColumn
-
setForUpdate
public void setForUpdate(boolean forUpdate) Mark this select as a SELECT FOR UPDATE. -
validateQuery
This method pre-validates the query, in terms of selected tables and columns.- Specified by:
validateQueryin interfaceQuery- Overrides:
validateQueryin classAbstractDMLQuery- Throws:
SQLException
-
setDistinct
public void setDistinct(boolean isDistinct) -
getOrderColumns
-
isSelectQuery
public boolean isSelectQuery()Description copied from class:AbstractDMLQueryGets whether this query is a SELECT query.- Overrides:
isSelectQueryin classAbstractDMLQuery
-
executePreparedValuesBatch
public BatchResponsePacket executePreparedValuesBatch(ISpaceProxy space, Transaction transaction, GPreparedStatement.PreparedValuesCollection preparedValuesCollection) throws SQLException Description copied from class:AbstractDMLQueryExecutes a query with batched prepared values. This is the default implementation - NOT optimized.- Overrides:
executePreparedValuesBatchin classAbstractDMLQuery- Returns:
- BatchResponsePacket
- Throws:
SQLException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classAbstractDMLQuery- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classAbstractDMLQuery- Throws:
IOExceptionClassNotFoundException
-