|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.command.Prepared
org.h2.command.dml.Query
org.h2.command.dml.SelectUnion
public class SelectUnion
Represents a union SELECT statement.
Field Summary | |
---|---|
static int |
EXCEPT
The type of an EXCEPT statement. |
static int |
INTERSECT
The type of an INTERSECT statement. |
static int |
UNION
The type of a UNION statement. |
static int |
UNION_ALL
The type of a UNION ALL statement. |
Fields inherited from class org.h2.command.dml.Query |
---|
limitExpr, offsetExpr, sampleSize |
Fields inherited from class org.h2.command.Prepared |
---|
headPos, parameters, prepareAlways, session, sqlStatement |
Constructor Summary | |
---|---|
SelectUnion(Session session,
Query query)
|
Method Summary | |
---|---|
void |
addGlobalCondition(Parameter param,
int columnId,
int comparisonType)
Add a condition to the query. |
int |
getColumnCount()
Get the column count of this query. |
double |
getCost()
Calculate the cost to execute this query. |
ObjectArray<Expression> |
getExpressions()
The the list of select expressions. |
java.lang.String |
getFirstColumnAlias(Session s)
Get the alias (or column name) of the first column. |
java.lang.String |
getPlanSQL()
Get the SQL statement with the execution plan. |
java.util.HashSet<Table> |
getTables()
Get all tables that are involved in this query. |
void |
init()
Initialize the query. |
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria. |
boolean |
isReadOnly()
Check if this command is read only. |
void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns to the given column resolver. |
void |
prepare()
Prepare this statement. |
LocalResult |
query(int limit)
Execute the query. |
LocalResult |
queryMeta()
Get an empty result set containing the meta data. |
protected LocalResult |
queryWithoutCache(int maxrows)
Execute the query without checking the cache. |
void |
setDistinct(boolean b)
Set the distinct flag. |
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Change the evaluatable flag. |
void |
setForUpdate(boolean forUpdate)
Set the 'for update' flag. |
void |
setOrder(ObjectArray<SelectOrderBy> order)
Set the order by list. |
void |
setRight(Query select)
|
void |
setSQL(java.lang.String sql)
Set the SQL statement. |
void |
setUnionType(int type)
|
void |
updateAggregate(Session s)
Update all aggregate function values. |
Methods inherited from class org.h2.command.dml.Query |
---|
getMaxDataModificationId, getParameterValues, isEverything, isQuery, isTransactional, prepareOrder, setLimit, setOffset, setSampleSize |
Methods inherited from class org.h2.command.Prepared |
---|
checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getSQL, getSQL, getSQL, needRecompile, setCommand, setCurrentRowNumber, setHeadPos, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, toString, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNION
public static final int UNION_ALL
public static final int EXCEPT
public static final int INTERSECT
Constructor Detail |
---|
public SelectUnion(Session session, Query query)
Method Detail |
---|
public void setUnionType(int type)
public void setRight(Query select)
public void setSQL(java.lang.String sql)
Prepared
setSQL
in class Prepared
sql
- the SQL statementpublic void setOrder(ObjectArray<SelectOrderBy> order)
Query
setOrder
in class Query
order
- the order by listpublic LocalResult queryMeta() throws java.sql.SQLException
Prepared
queryMeta
in class Prepared
java.sql.SQLException
protected LocalResult queryWithoutCache(int maxrows) throws java.sql.SQLException
Query
queryWithoutCache
in class Query
maxrows
- the limit as specified in the JDBC method call
java.sql.SQLException
public void init() throws java.sql.SQLException
Query
init
in class Query
java.sql.SQLException
public void prepare() throws java.sql.SQLException
Prepared
prepare
in class Prepared
java.sql.SQLException
public double getCost()
Query
getCost
in class Query
public java.util.HashSet<Table> getTables()
Query
getTables
in class Query
public void setDistinct(boolean b)
Query
setDistinct
in class Query
b
- the new valuepublic ObjectArray<Expression> getExpressions()
Query
getExpressions
in class Query
public void setForUpdate(boolean forUpdate)
Query
setForUpdate
in class Query
forUpdate
- the new settingpublic int getColumnCount()
Query
getColumnCount
in class Query
public void mapColumns(ColumnResolver resolver, int level) throws java.sql.SQLException
Query
mapColumns
in class Query
resolver
- the resolverlevel
- the subquery level (0 is the top level query, 1 is the first
subquery level)
java.sql.SQLException
public void setEvaluatable(TableFilter tableFilter, boolean b)
Query
setEvaluatable
in class Query
tableFilter
- the table filterb
- the new valuepublic void addGlobalCondition(Parameter param, int columnId, int comparisonType) throws java.sql.SQLException
Query
addGlobalCondition
in class Query
param
- the parametercolumnId
- the column index (0 meaning the first column)comparisonType
- the comparison type
java.sql.SQLException
public java.lang.String getPlanSQL()
Prepared
getPlanSQL
in class Prepared
public LocalResult query(int limit) throws java.sql.SQLException
Prepared
query
in class Query
limit
- the maximum number of rows to return
java.sql.SQLException
- if it is not a querypublic boolean isEverything(ExpressionVisitor visitor)
Query
isEverything
in class Query
visitor
- the visitor
public boolean isReadOnly()
Prepared
isReadOnly
in class Prepared
public void updateAggregate(Session s) throws java.sql.SQLException
Query
updateAggregate
in class Query
s
- the session
java.sql.SQLException
public java.lang.String getFirstColumnAlias(Session s)
Query
getFirstColumnAlias
in class Query
s
- the session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |