public class TableValueConstructor extends Query
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
Constructor and Description |
---|
TableValueConstructor(SessionLocal session,
java.util.ArrayList<java.util.ArrayList<Expression>> rows)
Creates new instance of table value constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addGlobalCondition(Parameter param,
int columnId,
int comparisonType)
Add a condition to the query.
|
boolean |
allowGlobalConditions()
Check whether adding condition to the query is allowed.
|
void |
fireBeforeSelectTriggers()
Call the before triggers on all tables.
|
double |
getCost()
Calculate the cost to execute this query.
|
Expression |
getIfSingleRow()
If this query is determined as a single-row query, returns a replacement
expression.
|
java.lang.String |
getPlanSQL(int sqlFlags)
Get the SQL statement with the execution plan.
|
java.util.HashSet<Table> |
getTables()
Get all tables that are involved in this query.
|
static void |
getValuesSQL(java.lang.StringBuilder builder,
int sqlFlags,
java.util.ArrayList<java.util.ArrayList<Expression>> rows)
Appends the SQL of the values to the specified string builder..
|
static void |
getVisibleResult(SessionLocal session,
ResultTarget result,
Column[] columns,
java.util.ArrayList<java.util.ArrayList<Expression>> rows)
Appends visible columns of all rows to the specified result.
|
void |
init()
Initialize the query.
|
boolean |
isConstantQuery()
Check if this query will always return the same value and has no side
effects.
|
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
boolean |
isUnion()
Check if this is a UNION query.
|
void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns to the given column resolver.
|
void |
prepareExpressions() |
void |
preparePlan() |
protected ResultInterface |
queryWithoutCache(long limit,
ResultTarget target)
Execute the query without checking the cache.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Change the evaluatable flag.
|
void |
setForUpdate(ForUpdate forUpdate)
Set the FOR UPDATE clause.
|
Table |
toTable(java.lang.String alias,
Column[] columnTemplates,
java.util.ArrayList<Parameter> parameters,
boolean forCreateView,
Query topQuery)
Converts this query to a table or a view.
|
void |
updateAggregate(SessionLocal s,
int stage)
Update all aggregate function values.
|
collectDependencies, disableCache, exists, getColumnCount, getCostAsExpression, getExpressions, getFetch, getForUpdate, getMaxDataModificationId, getOffset, getRowDataType, getType, hasOrder, isAnyDistinct, isFetchPercent, isNeverLazy, isQuery, isRandomAccessResult, isReadOnly, isRetryable, isStandardDistinct, isTransactional, isWithTies, prepare, query, query, queryMeta, setDistinctIfPossible, setFetch, setFetchPercent, setNeverLazy, setOffset, setOrder, setRandomAccessResult, setWithTies
checkCanceled, checkParameters, getCteCleanups, getCurrentRowNumber, getDatabase, getObjectId, getParameters, getPersistedObjectId, getSession, getSimpleSQL, getSQL, getSQLTokens, isCacheable, isWithParamValues, needRecompile, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, setWithParamValues, toString, update
public TableValueConstructor(SessionLocal session, java.util.ArrayList<java.util.ArrayList<Expression>> rows)
session
- the sessionrows
- the rowspublic static void getVisibleResult(SessionLocal session, ResultTarget result, Column[] columns, java.util.ArrayList<java.util.ArrayList<Expression>> rows)
session
- the sessionresult
- the resultcolumns
- the columnsrows
- the rows with datapublic static void getValuesSQL(java.lang.StringBuilder builder, int sqlFlags, java.util.ArrayList<java.util.ArrayList<Expression>> rows)
builder
- string buildersqlFlags
- formatting flagsrows
- the valuespublic boolean isUnion()
Query
protected ResultInterface queryWithoutCache(long limit, ResultTarget target)
Query
queryWithoutCache
in class Query
limit
- the limit as specified in the JDBC method calltarget
- the target to write results topublic void init()
Query
public void prepareExpressions()
prepareExpressions
in class Query
public void preparePlan()
preparePlan
in class Query
public double getCost()
Query
public java.util.HashSet<Table> getTables()
Query
public void setForUpdate(ForUpdate forUpdate)
Query
setForUpdate
in class Query
forUpdate
- the new FOR UPDATE clausepublic void mapColumns(ColumnResolver resolver, int level)
Query
mapColumns
in class Query
resolver
- the resolverlevel
- the subquery level (0 is the top level query, 1 is the first
subquery level)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)
Query
addGlobalCondition
in class Query
param
- the parametercolumnId
- the column index (0 meaning the first column)comparisonType
- the comparison typepublic boolean allowGlobalConditions()
Query
allowGlobalConditions
in class Query
public boolean isEverything(ExpressionVisitor visitor)
Query
isEverything
in class Query
visitor
- the visitorpublic void updateAggregate(SessionLocal s, int stage)
Query
updateAggregate
in class Query
s
- the sessionstage
- select stagepublic void fireBeforeSelectTriggers()
Query
fireBeforeSelectTriggers
in class Query
public java.lang.String getPlanSQL(int sqlFlags)
Prepared
getPlanSQL
in class Prepared
sqlFlags
- formatting flagspublic Table toTable(java.lang.String alias, Column[] columnTemplates, java.util.ArrayList<Parameter> parameters, boolean forCreateView, Query topQuery)
Query
public boolean isConstantQuery()
Query
isConstantQuery
in class Query
public Expression getIfSingleRow()
Query
getIfSingleRow
in class Query
null