| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | Query.
Evaluated values of OFFSET and FETCH clauses. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| pack-priv boolean | |
| pack-priv boolean | distinct
Whether the result must only contain distinct rows. |
| pack-priv Expression[] | expressionArray
Array of expressions. |
| pack-priv ArrayList | expressions
The column list, including invisible expressions such as order by expressions. |
| pack-priv Expression | fetchExpr
The fetch expression as specified in the FETCH, LIMIT, or TOP clause. |
| pack-priv boolean | fetchPercent
Whether limit expression specifies percentage of rows. |
| pack-priv boolean | |
| private long | |
| private Boolean | |
| private long | |
| private Value[] | |
| private ResultInterface | |
| private boolean | |
| private boolean | |
| pack-priv Expression | offsetExpr
The offset expression as specified in the OFFSET clause. |
| pack-priv ArrayList | orderList
Describes elements of the ORDER BY clause of a query. |
| private QueryScope | outerQueryScope
The outer scope of this query. |
| pack-priv boolean | randomAccessResult
Whether the result needs to support random access. |
| pack-priv int | resultColumnCount
Number of columns including visible columns and additional virtual columns for ORDER BY and DISTINCT ON clauses. |
| pack-priv SortOrder | sort
A sort order represents an ORDER BY clause in a query. |
| pack-priv int | visibleColumnCount
The visible columns (the ones required in the result). |
| private LinkedHashMap | withClause
The WITH clause of this query. |
| pack-priv boolean | withTies
Whether tied rows should be included in result too. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | addGlobalCondition(Parameter
the parameter param, int the column index (0 meaning the first column) columnId, int the comparison type comparisonType)Add a condition to the query. |
| pack-priv void | |
| public abstract boolean | Returns: true if adding global conditions is allowedCheck whether adding condition to the query is allowed. |
| pack-priv void | appendEndOfQueryToSQL(StringBuilder
query plan string builder. builder, int formatting flags sqlFlags, Expression[] the array of expressions expressions)Appends ORDER BY, OFFSET, and FETCH clauses to the plan. |
| private static boolean | Returns: whether the specified expression should be allowed in ORDER BY list of DISTINCT selectsession session, Expression expression to check expr, ArrayList<String> SQL of allowed expressions expressionSQL)An additional check for expression in ORDER BY list for DISTINCT selects that was not matched with selected expressions in regular way. |
| pack-priv void | |
| private void | |
| public void | collectDependencies(HashSet<DbObject>
collection of dependencies to populate dependencies)Overrides org. Find and collect all DbObjects, this Prepared depends on. |
| pack-priv LocalResult | Returns: the distinct resultthe source result)Convert a result into a distinct result, using the current columns. |
| public void | |
| private boolean | |
| public final boolean | |
| pack-priv LocalResult | Returns: the result or nullthe result result, long OFFSET value offset, long FETCH value fetch, boolean whether FETCH value is a PERCENT value fetchPercent, ResultTarget target result or null target)Applies limits, if any, to a result and makes it ready for value retrieval. |
| public abstract void | |
| public int | |
| public abstract double | |
| public int | Returns: the estimated cost as an integerCalculate the cost when used as a subquery. |
| public ArrayList | |
| public Expression | |
| public ForUpdate | |
| public Expression | Returns: the expression, ornullIf this query is determined as a single-row query, returns a replacement expression. |
| public final long | |
| private boolean | |
| public Expression | |
| pack-priv Query. | Returns: the evaluated valuesadditional limit maxRows)Evaluates OFFSET and FETCH expressions. |
| public QueryScope | |
| private Value[] | |
| public TypeInfo | |
| public abstract HashSet | |
| public int | getType()
Implements abstract org. Get the command type as defined in CommandInterface |
| public boolean | |
| public abstract void | |
| pack-priv int | Returns: index on the expression in theexpressions list.the select list SQL snippets expressionSQL, Expression the expression. e, boolean all order by expressions must be in the select list mustBeInResult, ArrayList<TableFilter> the table filters. filters)Initialize the 'ORDER BY' or 'DISTINCT' expressions. |
| pack-priv boolean | Returns: true if ORDER BY clause is preserved, false
otherwisethe select list SQL snippets expressionSQL, boolean all order by expressions must be in the select list mustBeInResult, ArrayList<TableFilter> the table filters filters)Initialize the order by list. |
| public boolean | |
| public boolean | Returns: if this query will always return the same value and has no side effects.Check if this query will always return the same value and has no side effects. |
| public abstract boolean | Returns: if the criteria can be fulfilledthe visitor visitor)Check if this expression and all sub-expressions can fulfill a criteria. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: whether results support random accessReturns whether results support random access. |
| public boolean | |
| public boolean | isRetryable()
Overrides org. Returns is this command can be repeated again on locking failure. |
| public boolean | |
| public boolean | isTransactional()
Implements abstract org. Check if this command is transactional. |
| public abstract boolean | |
| public boolean | |
| public abstract void | mapColumns(ColumnResolver
the resolver resolver, int the subquery level (0 is the top level query, 1 is the first
subquery level) level, boolean whether this method was called from the outer query outer)Map the columns to the given column resolver. |
| public final void | |
| public abstract void | |
| pack-priv void | prepareOrder(ArrayList<QueryOrderBy>
a list of orderList, int QueryOrderBy elementsthe number of columns in the query expressionCount)Create a |
| public abstract void | |
| public final ResultInterface | query(long
the maximum number of rows to return maxrows)Overrides org. Execute the query. |
| public final ResultInterface | Returns: the result set (if the target is not set).the maximum number of rows to return limit, ResultTarget the target result (null will return the result) target)Execute the query, writing the result to the target result. |
| public ResultInterface | queryMeta()
Implements abstract org. Get an empty result set containing the meta data. |
| protected abstract ResultInterface | Returns: the resultthe limit as specified in the JDBC method call limit, ResultTarget the target to write results to target)Execute the query without checking the cache. |
| private ResultInterface | |
| private static boolean | |
| public void | setDistinctIfPossible()
Set the distinct flag only if it is possible, may be used as a possible optimization only. |
| public abstract void | setEvaluatable(TableFilter
the table filter tableFilter, boolean the new value b)Change the evaluatable flag. |
| public void | |
| public void | |
| public abstract void | |
| public void | |
| public void | |
| public void | |
| public void | setOuterQueryScope(QueryScope
the scope of the outer query outerQueryScope)Sets the scope of the outer query. |
| public void | |
| public void | setWithClause(LinkedHashMap<String, Table>
the WITH clause of this query withClause)Sets the WITH clause of this query. |
| public void | |
| public Table | Returns: the table or the viewalias name for the view alias, Column[] column templates, or columnTemplates, ArrayList<Parameter> nullthe parameters parameters, boolean if true, a system session will be used for the view forCreateView, Query the top level query topQuery)Converts this query to a table or a view. |
| public abstract void | updateAggregate(SessionLocal
the session s, int select stage stage)Update all aggregate function values. |
| protected void |
| cacheableChecked | back to summary |
|---|---|
| private boolean cacheableChecked | |
| checkInit | back to summary |
|---|---|
| pack-priv boolean checkInit | |
| distinct | back to summary |
|---|---|
| pack-priv boolean distinct Whether the result must only contain distinct rows. | |
| expressionArray | back to summary |
|---|---|
| pack-priv Expression[] expressionArray Array of expressions.
| |
| expressions | back to summary |
|---|---|
| pack-priv ArrayList<Expression> expressions The column list, including invisible expressions such as order by expressions. | |
| fetchExpr | back to summary |
|---|---|
| pack-priv Expression fetchExpr The fetch expression as specified in the FETCH, LIMIT, or TOP clause. | |
| fetchPercent | back to summary |
|---|---|
| pack-priv boolean fetchPercent Whether limit expression specifies percentage of rows. | |
| isPrepared | back to summary |
|---|---|
| pack-priv boolean isPrepared | |
| lastEvaluated | back to summary |
|---|---|
| private long lastEvaluated | |
| lastExists | back to summary |
|---|---|
| private Boolean lastExists | |
| lastLimit | back to summary |
|---|---|
| private long lastLimit | |
| lastParameters | back to summary |
|---|---|
| private Value[] lastParameters | |
| lastResult | back to summary |
|---|---|
| private ResultInterface lastResult | |
| neverLazy | back to summary |
|---|---|
| private boolean neverLazy | |
| noCache | back to summary |
|---|---|
| private boolean noCache | |
| offsetExpr | back to summary |
|---|---|
| pack-priv Expression offsetExpr The offset expression as specified in the OFFSET clause. | |
| orderList | back to summary |
|---|---|
| pack-priv ArrayList<QueryOrderBy> orderList Describes elements of the ORDER BY clause of a query. | |
| outerQueryScope | back to summary |
|---|---|
| private QueryScope outerQueryScope The outer scope of this query. | |
| randomAccessResult | back to summary |
|---|---|
| pack-priv boolean randomAccessResult Whether the result needs to support random access. | |
| resultColumnCount | back to summary |
|---|---|
| pack-priv int resultColumnCount Number of columns including visible columns and additional virtual columns for ORDER BY and DISTINCT ON clauses. This number does not include virtual columns for HAVING and QUALIFY. | |
| sort | back to summary |
|---|---|
| pack-priv SortOrder sort A sort order represents an ORDER BY clause in a query. | |
| visibleColumnCount | back to summary |
|---|---|
| pack-priv int visibleColumnCount The visible columns (the ones required in the result). | |
| withClause | back to summary |
|---|---|
| private LinkedHashMap<String, Table> withClause The WITH clause of this query. | |
| withTies | back to summary |
|---|---|
| pack-priv boolean withTies Whether tied rows should be included in result too. | |
| Query | back to summary |
|---|---|
| pack-priv Query(SessionLocal session) | |
| addGlobalCondition | back to summary |
|---|---|
| public abstract void addGlobalCondition(Parameter param, int columnId, int comparisonType) Add a condition to the query. This is used for views.
| |
| addParameter | back to summary |
|---|---|
| pack-priv void addParameter(Parameter param) Add a parameter to the parameter list.
| |
| allowGlobalConditions | back to summary |
|---|---|
| public abstract boolean allowGlobalConditions() Check whether adding condition to the query is allowed. This is not allowed for views that have an order by and a limit, as it would affect the returned results.
| |
| appendEndOfQueryToSQL | back to summary |
|---|---|
| pack-priv void appendEndOfQueryToSQL(StringBuilder builder, int sqlFlags, Expression[] expressions) Appends ORDER BY, OFFSET, and FETCH clauses to the plan.
| |
| checkOrderOther | back to summary |
|---|---|
| private static boolean checkOrderOther(SessionLocal session, Expression expr, ArrayList<String> expressionSQL) An additional check for expression in ORDER BY list for DISTINCT selects that was not matched with selected expressions in regular way. This method allows expressions based only on selected expressions in different complicated ways with functions, comparisons, or operators.
| |
| cleanupOrder | back to summary |
|---|---|
| pack-priv void cleanupOrder() Removes constant expressions from the sort order. Some constants are detected only after optimization of expressions, this method removes them from the sort order only. They are currently preserved in the list of expressions. | |
| closeLastResult | back to summary |
|---|---|
| private void closeLastResult() | |
| collectDependencies | back to summary |
|---|---|
| public void collectDependencies(HashSet<DbObject> dependencies) Overrides org. Doc from org. Find and collect all DbObjects, this Prepared depends on. | |
| convertToDistinct | back to summary |
|---|---|
| pack-priv LocalResult convertToDistinct(ResultInterface result) Convert a result into a distinct result, using the current columns.
| |
| disableCache | back to summary |
|---|---|
| public void disableCache() Disable caching of result sets. | |
| executeExists | back to summary |
|---|---|
| private boolean executeExists() | |
| exists | back to summary |
|---|---|
| public final boolean exists() Execute the EXISTS predicate over the query.
| |
| finishResult | back to summary |
|---|---|
| pack-priv LocalResult finishResult(LocalResult result, long offset, long fetch, boolean fetchPercent, ResultTarget target) Applies limits, if any, to a result and makes it ready for value retrieval.
| |
| fireBeforeSelectTriggers | back to summary |
|---|---|
| public abstract void fireBeforeSelectTriggers() Call the before triggers on all tables. | |
| getColumnCount | back to summary |
|---|---|
| public int getColumnCount() Get the column count of this query.
| |
| getCost | back to summary |
|---|---|
| public abstract double getCost() Calculate the cost to execute this query.
| |
| getCostAsExpression | back to summary |
|---|---|
| public int getCostAsExpression() Calculate the cost when used as a subquery. This method returns a value between 10 and 1000000, to ensure adding other values can't result in an integer overflow.
| |
| getExpressions | back to summary |
|---|---|
| public ArrayList The the list of select expressions. This may include invisible expressions such as order by expressions.
| |
| getFetch | back to summary |
|---|---|
| public Expression getFetch() | |
| getForUpdate | back to summary |
|---|---|
| public ForUpdate getForUpdate() Returns FOR UPDATE clause, if any.
| |
| getIfSingleRow | back to summary |
|---|---|
| public Expression getIfSingleRow() If this query is determined as a single-row query, returns a replacement expression.
| |
| getMaxDataModificationId | back to summary |
|---|---|
| public final long getMaxDataModificationId() | |
| getNoCache | back to summary |
|---|---|
| private boolean getNoCache() | |
| getOffset | back to summary |
|---|---|
| public Expression getOffset() | |
| getOffsetFetch | back to summary |
|---|---|
| pack-priv Query. Evaluates OFFSET and FETCH expressions.
| |
| getOuterQueryScope | back to summary |
|---|---|
| public QueryScope getOuterQueryScope() Returns the scope of the outer query.
| |
| getParameterValues | back to summary |
|---|---|
| private Value[] getParameterValues() | |
| getRowDataType | back to summary |
|---|---|
| public TypeInfo getRowDataType() Returns data type of rows.
| |
| getTables | back to summary |
|---|---|
| public abstract HashSet Get all tables that are involved in this query. | |
| getType | back to summary |
|---|---|
| public int getType() Implements abstract org. Doc from org. Get the command type as defined in CommandInterface
| |
| hasOrder | back to summary |
|---|---|
| public boolean hasOrder() Whether the query has an order.
| |
| init | back to summary |
|---|---|
| public abstract void init() Initialize the query. | |
| initExpression | back to summary |
|---|---|
| pack-priv int initExpression(ArrayList<String> expressionSQL, Expression e, boolean mustBeInResult, ArrayList<TableFilter> filters) Initialize the 'ORDER BY' or 'DISTINCT' expressions.
| |
| initOrder | back to summary |
|---|---|
| pack-priv boolean initOrder(ArrayList<String> expressionSQL, boolean mustBeInResult, ArrayList<TableFilter> filters) Initialize the order by list. This call may extend the expressions list.
| |
| isAnyDistinct | back to summary |
|---|---|
public boolean isAnyDistinct()
| |
| isConstantQuery | back to summary |
|---|---|
| public boolean isConstantQuery() Check if this query will always return the same value and has no side effects.
| |
| isEverything | back to summary |
|---|---|
| public abstract boolean isEverything(ExpressionVisitor visitor) Check if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.
| |
| isFetchPercent | back to summary |
|---|---|
| public boolean isFetchPercent() | |
| isNeverLazy | back to summary |
|---|---|
| public boolean isNeverLazy() | |
| isQuery | back to summary |
|---|---|
| public boolean isQuery() Overrides org. Doc from org. Check if this object is a query.
| |
| isRandomAccessResult | back to summary |
|---|---|
| public boolean isRandomAccessResult() Returns whether results support random access.
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Overrides org. Doc from org. Check if this command is read only.
| |
| isRetryable | back to summary |
|---|---|
| public boolean isRetryable() Overrides org. Doc from org. Returns is this command can be repeated again on locking failure.
| |
| isStandardDistinct | back to summary |
|---|---|
public boolean isStandardDistinct()
| |
| isTransactional | back to summary |
|---|---|
| public boolean isTransactional() Implements abstract org. Doc from org. Check if this command is transactional. If it is not, then it forces the current transaction to commit.
| |
| isUnion | back to summary |
|---|---|
| public abstract boolean isUnion() Check if this is a UNION query.
| |
| isWithTies | back to summary |
|---|---|
| public boolean isWithTies() | |
| mapColumns | back to summary |
|---|---|
| public abstract void mapColumns(ColumnResolver resolver, int level, boolean outer) Map the columns to the given column resolver.
| |
| prepare | back to summary |
|---|---|
| public final void prepare() Overrides org. Doc from org. Prepare this statement.
| |
| prepareExpressions | back to summary |
|---|---|
| public abstract void prepareExpressions() | |
| prepareOrder | back to summary |
|---|---|
| pack-priv void prepareOrder(ArrayList<QueryOrderBy> orderList, int expressionCount) Create a
| |
| preparePlan | back to summary |
|---|---|
| public abstract void preparePlan() | |
| query | back to summary |
|---|---|
| public final ResultInterface query(long maxrows) Overrides org. Doc from org. Execute the query.
| |
| query | back to summary |
|---|---|
| public final ResultInterface query(long limit, ResultTarget target) Execute the query, writing the result to the target result.
| |
| queryMeta | back to summary |
|---|---|
| public ResultInterface queryMeta() Implements abstract org. Doc from org. Get an empty result set containing the meta data.
| |
| queryWithoutCache | back to summary |
|---|---|
| protected abstract ResultInterface queryWithoutCache(long limit, ResultTarget target) Execute the query without checking the cache. If a target is specified, the results are written to it, and the method returns null. If no target is specified, a new LocalResult is created and returned.
| |
| queryWithoutCacheLazyCheck | back to summary |
|---|---|
| private ResultInterface queryWithoutCacheLazyCheck(long limit, ResultTarget target) | |
| sameParameters | back to summary |
|---|---|
| private static boolean sameParameters(Value[] params, Value[] lastParams) | |
| setDistinctIfPossible | back to summary |
|---|---|
| public void setDistinctIfPossible() Set the distinct flag only if it is possible, may be used as a possible optimization only. | |
| setEvaluatable | back to summary |
|---|---|
| public abstract void setEvaluatable(TableFilter tableFilter, boolean b) Change the evaluatable flag. This is used when building the execution plan.
| |
| setFetch | back to summary |
|---|---|
| public void setFetch(Expression fetch) | |
| setFetchPercent | back to summary |
|---|---|
| public void setFetchPercent(boolean fetchPercent) | |
| setForUpdate | back to summary |
|---|---|
| public abstract void setForUpdate(ForUpdate forUpdate) Set the FOR UPDATE clause.
| |
| setNeverLazy | back to summary |
|---|---|
| public void setNeverLazy(boolean b) | |
| setOffset | back to summary |
|---|---|
| public void setOffset(Expression offset) | |
| setOrder | back to summary |
|---|---|
| public void setOrder(ArrayList<QueryOrderBy> order) Set the order by list.
| |
| setOuterQueryScope | back to summary |
|---|---|
| public void setOuterQueryScope(QueryScope outerQueryScope) Sets the scope of the outer query.
| |
| setRandomAccessResult | back to summary |
|---|---|
| public void setRandomAccessResult(boolean b) Whether results need to support random access.
| |
| setWithClause | back to summary |
|---|---|
| public void setWithClause(LinkedHashMap<String, Table> withClause) Sets the WITH clause of this query.
| |
| setWithTies | back to summary |
|---|---|
| public void setWithTies(boolean withTies) | |
| toTable | back to summary |
|---|---|
| public Table toTable(String alias, Column[] columnTemplates, ArrayList<Parameter> parameters, boolean forCreateView, Query topQuery) Converts this query to a table or a view. | |
| updateAggregate | back to summary |
|---|---|
| public abstract void updateAggregate(SessionLocal s, int stage) Update all aggregate function values.
| |
| writeWithList | back to summary |
|---|---|
| protected void writeWithList(StringBuilder builder, int sqlFlags) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final long | fetch
FETCH value. |
| pack-priv final boolean | fetchPercent
Whether FETCH value is a PERCENT value. |
| pack-priv final long | offset
OFFSET value. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| fetch | back to summary |
|---|---|
| pack-priv final long fetch FETCH value. | |
| fetchPercent | back to summary |
|---|---|
| pack-priv final boolean fetchPercent Whether FETCH value is a PERCENT value. | |
| offset | back to summary |
|---|---|
| pack-priv final long offset OFFSET value. | |
| OffsetFetch | back to summary |
|---|---|
| pack-priv OffsetFetch(long offset, long fetch, boolean fetchPercent) | |