public final class Query extends BaseObject implements Cloneable, Serializable
DataContext
,
Serialized FormConstructor and Description |
---|
Query() |
Modifier and Type | Method and Description |
---|---|
Query |
clone() |
protected void |
decorateIdentity(List<Object> identifiers)
Subclasses should implement this method and add all fields to the list
that are to be included in equals(...) and hashCode() evaluation
|
Query |
from(FromItem... items) |
Query |
from(String expression) |
Query |
from(Table table) |
Query |
from(Table table,
String alias) |
Query |
from(Table leftTable,
Table rightTable,
JoinType joinType,
Column leftOnColumn,
Column rightOnColumn) |
Integer |
getFirstRow()
Gets the first row (aka offset) of the query's result, or null if none is
specified.
|
FromClause |
getFromClause() |
GroupByClause |
getGroupByClause() |
FilterClause |
getHavingClause() |
Integer |
getMaxRows() |
OrderByClause |
getOrderByClause() |
SelectClause |
getSelectClause() |
FilterClause |
getWhereClause() |
Query |
groupBy(Column... columns) |
Query |
groupBy(GroupByItem... items) |
Query |
groupBy(List<Column> columns) |
Query |
groupBy(String... groupByTokens) |
Query |
having(Column column,
OperatorType operatorType,
Object operand) |
Query |
having(FilterItem... items) |
Query |
having(FunctionType function,
Column column,
OperatorType operatorType,
Object operand) |
Query |
having(String... havingItemTokens) |
InvokableQuery |
invokable(DataContext dataContext) |
Query |
orderBy(Column column) |
Query |
orderBy(Column column,
OrderByItem.Direction direction) |
Query |
orderBy(OrderByItem... items) |
Query |
orderBy(String... orderByTokens) |
Query |
select(Column... columns) |
Query |
select(Column column,
FromItem fromItem) |
Query |
select(FunctionType functionType,
Column column) |
Query |
select(List<Column> columns) |
Query |
select(SelectItem... items) |
Query |
select(String expression)
Adds a selection to this query.
|
Query |
select(String expression,
boolean allowExpressionBasedSelectItem)
Adds a selection to this query.
|
Query |
select(String expression,
String alias) |
Query |
selectAll()
Select all available select items from all currently available FROM
items.
|
Query |
selectAll(FromItem fromItem) |
Query |
selectCount() |
Query |
selectDistinct() |
Query |
setFirstRow(Integer firstRow)
Sets the first row (aka offset) of the query's result.
|
Query |
setMaxRows(Integer maxRows)
Sets the maximum number of rows to be queried.
|
String |
toSql() |
protected String |
toSql(boolean includeSchemaInColumnPaths) |
String |
toString() |
Query |
where(Column column,
OperatorType operatorType,
Object operand) |
Query |
where(FilterItem... items) |
Query |
where(Iterable<FilterItem> items) |
Query |
where(SelectItem selectItem,
OperatorType operatorType,
Object operand) |
Query |
where(String... whereItemTokens) |
classEquals, equals, hashCode
public Query select(SelectItem... items)
public Query select(FunctionType functionType, Column column)
public Query select(String expression)
expression
- public Query select(String expression, boolean allowExpressionBasedSelectItem)
expression
- a textual representation of the select item, e.g. "MAX(foo)"
or just "foo", where "foo" is a column name.allowExpressionBasedSelectItem
- whether or not expression-based select items are allowed or
not (see SelectItem.getExpression()
.public Query selectAll()
public Query selectDistinct()
public Query selectCount()
public Query from(Table leftTable, Table rightTable, JoinType joinType, Column leftOnColumn, Column rightOnColumn)
public Query groupBy(GroupByItem... items)
public Query orderBy(OrderByItem... items)
public Query orderBy(Column column, OrderByItem.Direction direction)
public Query where(FilterItem... items)
public Query where(Iterable<FilterItem> items)
public Query where(SelectItem selectItem, OperatorType operatorType, Object operand)
public Query where(Column column, OperatorType operatorType, Object operand)
public Query having(FilterItem... items)
public Query having(FunctionType function, Column column, OperatorType operatorType, Object operand)
public Query having(Column column, OperatorType operatorType, Object operand)
public String toString()
toString
in class BaseObject
public String toSql()
protected String toSql(boolean includeSchemaInColumnPaths)
public SelectClause getSelectClause()
public FromClause getFromClause()
public FilterClause getWhereClause()
public GroupByClause getGroupByClause()
public FilterClause getHavingClause()
public OrderByClause getOrderByClause()
public Query setMaxRows(Integer maxRows)
maxRows
- the number of desired maximum rows. Can be null (default) for
no limitspublic Integer getMaxRows()
public Query setFirstRow(Integer firstRow)
firstRow
- the first row, where 1 is the first row.public Integer getFirstRow()
public InvokableQuery invokable(DataContext dataContext)
protected void decorateIdentity(List<Object> identifiers)
BaseObject
decorateIdentity
in class BaseObject
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.