dk.eobjects.metamodel.query.Query.getGroupByClause()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中dk.eobjects.metamodel.query.Query.getGroupByClause方法的一些代码示例,展示了Query.getGroupByClause的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getGroupByClause方法的具体详情如下:
包路径:dk.eobjects.metamodel.query.Query
类名称:Query
方法名:getGroupByClause

Query.getGroupByClause介绍

暂无

代码示例

代码示例来源:origin: dk.eobjects.commons/MetaModel

@Override
public boolean equals(Object obj) {
  if (obj == this) {
    return true;
  }
  if (obj instanceof Query) {
    Query that = (Query) obj;
    EqualsBuilder eb = new EqualsBuilder();
    eb.append(this.getMaxRows(), that.getMaxRows());
    eb.append(this.getSelectClause(), that.getSelectClause());
    eb.append(this.getFromClause(), that.getFromClause());
    eb.append(this.getWhereClause(), that.getWhereClause());
    eb.append(this.getGroupByClause(), that.getGroupByClause());
    eb.append(this.getHavingClause(), that.getHavingClause());
    eb.append(this.getOrderByClause(), that.getOrderByClause());
    return eb.isEquals();
  }
  return false;
}

代码示例来源:origin: dk.eobjects.metamodel/MetaModel-jdbc

public String rewriteQuery(JdbcDataContextStrategy strategy, Query query) {
  query = beforeRewrite(strategy, query);
  StringBuilder sb = new StringBuilder();
  sb
      .append(rewriteSelectClause(strategy, query, query
          .getSelectClause()));
  sb.append(rewriteFromClause(strategy, query, query.getFromClause()));
  sb.append(rewriteWhereClause(strategy, query, query.getWhereClause()));
  sb.append(rewriteGroupByClause(strategy, query, query
      .getGroupByClause()));
  sb
      .append(rewriteHavingClause(strategy, query, query
          .getHavingClause()));
  sb.append(rewriteOrderByClause(strategy, query, query
      .getOrderByClause()));
  return sb.toString();
}

代码示例来源:origin: dk.eobjects.commons/MetaModel

public String rewriteQuery(JdbcDataContextStrategy strategy, Query query) {
  query = beforeRewrite(strategy, query);
  StringBuilder sb = new StringBuilder();
  sb
      .append(rewriteSelectClause(strategy, query, query
          .getSelectClause()));
  sb.append(rewriteFromClause(strategy, query, query.getFromClause()));
  sb.append(rewriteWhereClause(strategy, query, query.getWhereClause()));
  sb.append(rewriteGroupByClause(strategy, query, query
      .getGroupByClause()));
  sb
      .append(rewriteHavingClause(strategy, query, query
          .getHavingClause()));
  sb.append(rewriteOrderByClause(strategy, query, query
      .getOrderByClause()));
  return sb.toString();
}

代码示例来源:origin: dk.eobjects.metamodel/MetaModel-jdbc

/**
 * Determines if a query is of a complex type which may be error-prone to
 * execute on some databases and therefore should be tried to execute with a
 * query postprocessing strategy
 */
private boolean isComplexQuery(Query q) {
  if (q.getWhereClause().getItemCount() > 0) {
    return true;
  }
  if (q.getGroupByClause().getItemCount() > 0) {
    return true;
  }
  if (q.getHavingClause().getItemCount() > 0) {
    return true;
  }
  if (q.getOrderByClause().getItemCount() > 0) {
    return true;
  }
  return false;
}

代码示例来源:origin: dk.eobjects.commons/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: dk.eobjects.commons/MetaModel

/**
 * Determines if a query is of a complex type which may be error-prone to
 * execute on some databases and therefore should be tried to execute with a
 * query postprocessing strategy
 */
private boolean isComplexQuery(Query q) {
  if (q.getWhereClause().getItemCount() > 0) {
    return true;
  }
  if (q.getGroupByClause().getItemCount() > 0) {
    return true;
  }
  if (q.getHavingClause().getItemCount() > 0) {
    return true;
  }
  if (q.getOrderByClause().getItemCount() > 0) {
    return true;
  }
  return false;
}

代码示例来源:origin: dk.eobjects.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: dk.eobjects.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) {

代码示例来源:origin: dk.eobjects.commons/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) {

代码示例来源:origin: dk.eobjects.commons/MetaModel

List<SelectItem> whereSelectItems = query.getWhereClause()
    .getEvaluatedSelectItems();
List<GroupByItem> groupByItems = query.getGroupByClause().getItems();
List<SelectItem> havingSelectItems = query.getHavingClause()
    .getEvaluatedSelectItems();

代码示例来源:origin: dk.eobjects.metamodel/MetaModel-querypostprocessor

List<SelectItem> whereSelectItems = query.getWhereClause()
    .getEvaluatedSelectItems();
List<GroupByItem> groupByItems = query.getGroupByClause().getItems();
List<SelectItem> havingSelectItems = query.getHavingClause()
    .getEvaluatedSelectItems();

相关文章