本文整理了Java中org.apache.metamodel.query.Query.getGroupByClause
方法的一些代码示例,展示了Query.getGroupByClause
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getGroupByClause
方法的具体详情如下:
包路径:org.apache.metamodel.query.Query
类名称:Query
方法名:getGroupByClause
暂无
代码示例来源:origin: apache/metamodel
public String rewriteQuery(Query query) {
query = beforeRewrite(query);
final StringBuilder sb = new StringBuilder();
sb.append(rewriteSelectClause(query, query.getSelectClause()));
sb.append(rewriteFromClause(query, query.getFromClause()));
sb.append(rewriteWhereClause(query, query.getWhereClause()));
sb.append(rewriteGroupByClause(query, query.getGroupByClause()));
sb.append(rewriteHavingClause(query, query.getHavingClause()));
sb.append(rewriteOrderByClause(query, query.getOrderByClause()));
return sb.toString();
}
代码示例来源:origin: org.apache.metamodel/MetaModel-jdbc
public String rewriteQuery(Query query) {
query = beforeRewrite(query);
final StringBuilder sb = new StringBuilder();
sb.append(rewriteSelectClause(query, query.getSelectClause()));
sb.append(rewriteFromClause(query, query.getFromClause()));
sb.append(rewriteWhereClause(query, query.getWhereClause()));
sb.append(rewriteGroupByClause(query, query.getGroupByClause()));
sb.append(rewriteHavingClause(query, query.getHavingClause()));
sb.append(rewriteOrderByClause(query, query.getOrderByClause()));
return sb.toString();
}
代码示例来源:origin: org.apache.metamodel/MetaModel-jdbc
/**
* Gets whether a query is guaranteed to only yield a single row. Such
* queries are queries that only consist of aggregation functions and no
* group by clause.
*
* @param query
* @return
*/
private boolean isSingleRowQuery(Query query) {
if (!query.getGroupByClause().isEmpty()) {
return false;
}
List<SelectItem> items = query.getSelectClause().getItems();
for (SelectItem item : items) {
if (item.getAggregateFunction() == null) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/metamodel
/**
* Gets whether a query is guaranteed to only yield a single row. Such
* queries are queries that only consist of aggregation functions and no
* group by clause.
*
* @param query
* @return
*/
private boolean isSingleRowQuery(Query query) {
if (!query.getGroupByClause().isEmpty()) {
return false;
}
List<SelectItem> items = query.getSelectClause().getItems();
for (SelectItem item : items) {
if (item.getAggregateFunction() == null) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.metamodel/MetaModel-salesforce
if (!query.getGroupByClause().isEmpty()) {
return super.executeQuery(query);
代码示例来源:origin: apache/metamodel
if (!query.getGroupByClause().isEmpty()) {
return super.executeQuery(query);
代码示例来源:origin: org.apache.metamodel/MetaModel-jdbc
private long getRowCount(Query q) {
q = q.clone();
SelectItem countAllItem = SelectItem.getCountAllItem();
if (q.getGroupByClause().getItemCount() > 0) {
q = new Query().from(new FromItem(q).setAlias("sq")).select(countAllItem);
} else {
q.getSelectClause().removeItems();
q.select(countAllItem);
}
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
Number count = (Number) row.getValue(countAllItem);
return count.longValue();
}
代码示例来源:origin: apache/metamodel
private long getRowCount(Query q) {
q = q.clone();
SelectItem countAllItem = SelectItem.getCountAllItem();
if (q.getGroupByClause().getItemCount() > 0) {
q = new Query().from(new FromItem(q).setAlias("sq")).select(countAllItem);
} else {
q.getSelectClause().removeItems();
q.select(countAllItem);
}
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
Number count = (Number) row.getValue(countAllItem);
return count.longValue();
}
代码示例来源:origin: apache/metamodel
private List<Column> getSplitColumns() {
List<Column> result = new ArrayList<Column>();
if (_query.getGroupByClause().getItemCount() != 0) {
List<GroupByItem> groupByItems = _query.getGroupByClause().getItems();
for (GroupByItem groupByItem : groupByItems) {
Column column = groupByItem.getSelectItem().getColumn();
代码示例来源:origin: org.apache.metamodel/MetaModel-core
if (!getScalarFunctionSelectItems(query.getGroupByClause().getEvaluatedSelectItems()).isEmpty()) {
return true;
代码示例来源:origin: apache/metamodel
if (!getScalarFunctionSelectItems(query.getGroupByClause().getEvaluatedSelectItems()).isEmpty()) {
return true;
代码示例来源:origin: org.apache.metamodel/MetaModel-jdbc
private List<Column> getSplitColumns() {
List<Column> result = new ArrayList<Column>();
if (_query.getGroupByClause().getItemCount() != 0) {
List<GroupByItem> groupByItems = _query.getGroupByClause().getItems();
for (GroupByItem groupByItem : groupByItems) {
Column column = groupByItem.getSelectItem().getColumn();
代码示例来源:origin: org.apache.metamodel/MetaModel-mongodb-mongo3
if (query.getGroupByClause().isEmpty() && query.getHavingClause().isEmpty()
&& query.getOrderByClause().isEmpty()) {
代码示例来源:origin: org.apache.metamodel/MetaModel-mongodb-mongo2
if (query.getGroupByClause().isEmpty() && query.getHavingClause().isEmpty()
&& query.getOrderByClause().isEmpty()) {
代码示例来源:origin: apache/metamodel
if (query.getGroupByClause().isEmpty() && query.getHavingClause().isEmpty()
&& query.getOrderByClause().isEmpty()) {
代码示例来源:origin: apache/metamodel
if (query.getGroupByClause().isEmpty() && query.getHavingClause().isEmpty()
&& query.getOrderByClause().isEmpty()) {
代码示例来源:origin: org.apache.metamodel/MetaModel-core
final List<FilterItem> whereItems = query.getWhereClause().getItems();
final List<SelectItem> whereSelectItems = query.getWhereClause().getEvaluatedSelectItems();
final List<GroupByItem> groupByItems = query.getGroupByClause().getItems();
final List<SelectItem> groupBySelectItems = query.getGroupByClause().getEvaluatedSelectItems();
final List<SelectItem> havingSelectItems = query.getHavingClause().getEvaluatedSelectItems();
final List<SelectItem> orderBySelectItems = query.getOrderByClause().getEvaluatedSelectItems();
代码示例来源:origin: apache/metamodel
final List<FilterItem> whereItems = query.getWhereClause().getItems();
final List<SelectItem> whereSelectItems = query.getWhereClause().getEvaluatedSelectItems();
final List<GroupByItem> groupByItems = query.getGroupByClause().getItems();
final List<SelectItem> groupBySelectItems = query.getGroupByClause().getEvaluatedSelectItems();
final List<SelectItem> havingSelectItems = query.getHavingClause().getEvaluatedSelectItems();
final List<SelectItem> orderBySelectItems = query.getOrderByClause().getEvaluatedSelectItems();
内容来源于网络,如有侵权,请联系作者删除!