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

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

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

Query.getSelectClause介绍

暂无

代码示例

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

public JdbcDataSetStrategy(Query query, Statement statement,
    ResultSet resultSet) {
  if (query == null || statement == null || resultSet == null) {
    throw new IllegalArgumentException("Arguments cannot be null");
  }
  List<SelectItem> items = query.getSelectClause().getItems();
  _selectItems = items.toArray(new SelectItem[items.size()]);
  _statement = statement;
  _resultSet = resultSet;
}

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

public SplitQueriesDataSetStrategy(DataContext dataContext,
    List<Query> splitQueries) {
  if (dataContext == null || splitQueries == null) {
    throw new IllegalArgumentException("Arguments cannot be null");
  }
  _dataContext = dataContext;
  _queryIterator = splitQueries.iterator();
  if (splitQueries.size() == 0) {
    _selectItems = new SelectItem[0];
  } else {
    _selectItems = splitQueries.get(0).getSelectClause().getItems()
        .toArray(new SelectItem[0]);
  }
}

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

public SplitQueriesDataSetStrategy(DataContext dataContext,
    List<Query> splitQueries) {
  if (dataContext == null || splitQueries == null) {
    throw new IllegalArgumentException("Arguments cannot be null");
  }
  _dataContext = dataContext;
  _queryIterator = splitQueries.iterator();
  if (splitQueries.size() == 0) {
    _selectItems = new SelectItem[0];
  } else {
    _selectItems = splitQueries.get(0).getSelectClause().getItems()
        .toArray(new SelectItem[0]);
  }
}

代码示例来源: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.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.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-querypostprocessor

if (query != null) {
  List<SelectItem> selectItems = collectSelectItems(query
      .getSelectClause().getItems(), query.getWhereClause()
      .getEvaluatedSelectItems(), query.getHavingClause()
      .getEvaluatedSelectItems());

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

public DataSet executeQuery(Query query) {
  List<SelectItem> selectItems = query.getSelectClause().getItems();
  List<FromItem> fromItems = query.getFromClause().getItems();
  List<FilterItem> whereItems = query.getWhereClause().getItems();
  if (query.getSelectClause().isDistinct()) {
    dataSet = MetaModelHelper.getSelection(selectItems, dataSet);
    dataSet = MetaModelHelper.getDistinct(dataSet);

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

public DataSet executeQuery(Query query) {
  List<SelectItem> selectItems = query.getSelectClause().getItems();
  List<FromItem> fromItems = query.getFromClause().getItems();
  List<FilterItem> whereItems = query.getWhereClause().getItems();

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

if (query != null) {
  List<SelectItem> selectItems = collectSelectItems(query
      .getSelectClause().getItems(), query.getWhereClause()
      .getEvaluatedSelectItems(), query.getHavingClause()
      .getEvaluatedSelectItems());

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

@Override
protected Query beforeRewrite(JdbcDataContextStrategy strategy, Query query) {
  query = query.clone();
  if (strategy != null) {
    String identifierQuoteString = strategy.getIdentifierQuoteString();
    if (identifierQuoteString != null) {
      List<SelectItem> selectItems = query.getSelectClause()
          .getItems();
      for (SelectItem item : selectItems) {
        String alias = item.getAlias();
        if (needsQuoting(alias, identifierQuoteString)) {
          item.setAlias(identifierQuoteString + alias
              + identifierQuoteString);
        }
      }
      List<FromItem> fromItems = query.getFromClause().getItems();
      for (FromItem item : fromItems) {
        String alias = item.getAlias();
        if (needsQuoting(alias, identifierQuoteString)) {
          item.setAlias(identifierQuoteString + alias
              + identifierQuoteString);
        }
      }
    }
  }
  return query;
}

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

@Override
protected Query beforeRewrite(JdbcDataContextStrategy strategy, Query query) {
  query = query.clone();
  if (strategy != null) {
    String identifierQuoteString = strategy.getIdentifierQuoteString();
    if (identifierQuoteString != null) {
      List<SelectItem> selectItems = query.getSelectClause()
          .getItems();
      for (SelectItem item : selectItems) {
        String alias = item.getAlias();
        if (needsQuoting(alias, identifierQuoteString)) {
          item.setAlias(identifierQuoteString + alias
              + identifierQuoteString);
        }
      }
      List<FromItem> fromItems = query.getFromClause().getItems();
      for (FromItem item : fromItems) {
        String alias = item.getAlias();
        if (needsQuoting(alias, identifierQuoteString)) {
          item.setAlias(identifierQuoteString + alias
              + identifierQuoteString);
        }
      }
    }
  }
  return query;
}

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

@Override
  public Query clone() {
    Query q = new Query();
    q.setMaxRows(_maxRows);
    q.getSelectClause().setDistinct(_selectClause.isDistinct());
    for (FromItem item : _fromClause.getItems()) {
      q.from(item.clone());
    }
    for (SelectItem item : _selectClause.getItems()) {
      q.select(item.clone());
    }
    for (FilterItem item : _whereClause.getItems()) {
      q.where(item.clone());
    }
    for (GroupByItem item : _groupByClause.getItems()) {
      q.groupBy(item.clone());
    }
    for (FilterItem item : _havingClause.getItems()) {
      q.having(item.clone());
    }
    for (OrderByItem item : _orderByClause.getItems()) {
      q.orderBy(item.clone());
    }
    return q;
  }
}

相关文章