org.apache.metamodel.query.Query.selectAll()方法的使用及代码示例

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

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

Query.selectAll介绍

[英]Select all available select items from all currently available FROM items. Equivalent of the expression "SELECT * FROM ..." in SQL.
[中]选择所有可用项从所有当前可用项中选择项。相当于表达式“选择*自…”在SQL中。

代码示例

代码示例来源:origin: org.apache.metamodel/MetaModel-core

/**
 * Select all available select items from all currently available FROM
 * items. Equivalent of the expression "SELECT * FROM ..." in SQL.
 * 
 * @return
 */
public Query selectAll() {
  List<FromItem> items = getFromClause().getItems();
  for (FromItem fromItem : items) {
    selectAll(fromItem);
  }
  return this;
}

代码示例来源:origin: apache/metamodel

/**
 * Select all available select items from all currently available FROM
 * items. Equivalent of the expression "SELECT * FROM ..." in SQL.
 * 
 * @return
 */
public Query selectAll() {
  List<FromItem> items = getFromClause().getItems();
  for (FromItem fromItem : items) {
    selectAll(fromItem);
  }
  return this;
}

代码示例来源:origin: apache/metamodel

@Override
public void parse(String delim, String itemToken) throws MetaModelException {
  if ("*".equals(itemToken)) {
    _query.selectAll();
    return;
  }
  String alias = null;
  final int indexOfAlias = itemToken.toUpperCase().lastIndexOf(" AS ");
  if (indexOfAlias != -1) {
    alias = itemToken.substring(indexOfAlias + " AS ".length());
    itemToken = itemToken.substring(0, indexOfAlias).trim();
  }
  try {
    final SelectItem selectItem = findSelectItem(itemToken);
    if (selectItem == null) {
      throw new QueryParserException("Not capable of parsing SELECT token: " + itemToken);
    }
    if (alias != null) {
      selectItem.setAlias(alias);
    }
    _query.select(selectItem);
  } catch (MultipleSelectItemsParsedException e) {
    FromItem fromItem = e.getFromItem();
    if (fromItem != null) {
      _query.selectAll(fromItem);
    } else {
      throw e;
    }
  }
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public void parse(String delim, String itemToken) throws MetaModelException {
  if ("*".equals(itemToken)) {
    _query.selectAll();
    return;
  }
  String alias = null;
  final int indexOfAlias = itemToken.toUpperCase().lastIndexOf(" AS ");
  if (indexOfAlias != -1) {
    alias = itemToken.substring(indexOfAlias + " AS ".length());
    itemToken = itemToken.substring(0, indexOfAlias).trim();
  }
  try {
    final SelectItem selectItem = findSelectItem(itemToken);
    if (selectItem == null) {
      throw new QueryParserException("Not capable of parsing SELECT token: " + itemToken);
    }
    if (alias != null) {
      selectItem.setAlias(alias);
    }
    _query.select(selectItem);
  } catch (MultipleSelectItemsParsedException e) {
    FromItem fromItem = e.getFromItem();
    if (fromItem != null) {
      _query.selectAll(fromItem);
    } else {
      throw e;
    }
  }
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public SatisfiedSelectBuilder<?> selectAll() {
  getQuery().selectAll();
  GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

代码示例来源:origin: apache/metamodel

@Override
public SatisfiedSelectBuilder<?> selectAll() {
  getQuery().selectAll();
  GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

public Query selectAll(final FromItem fromItem) {
  if (fromItem.getTable() != null) {
    final List<Column> columns = fromItem.getTable().getColumns();
    for (final Column column : columns) {
      select(column, fromItem);
    }
  } else if (fromItem.getJoin() != null) {
    selectAll(fromItem.getLeftSide());
    selectAll(fromItem.getRightSide());
  } else if (fromItem.getSubQuery() != null) {
    final List<SelectItem> items = fromItem.getSubQuery().getSelectClause().getItems();
    for (final SelectItem subQuerySelectItem : items) {
      select(new SelectItem(subQuerySelectItem, fromItem));
    }
  } else {
    throw new MetaModelException("All select items ('*') not determinable with from item: " + fromItem);
  }
  return this;
}

代码示例来源:origin: apache/metamodel

public Query selectAll(final FromItem fromItem) {
  if (fromItem.getTable() != null) {
    final List<Column> columns = fromItem.getTable().getColumns();
    for (final Column column : columns) {
      select(column, fromItem);
    }
  } else if (fromItem.getJoin() != null) {
    selectAll(fromItem.getLeftSide());
    selectAll(fromItem.getRightSide());
  } else if (fromItem.getSubQuery() != null) {
    final List<SelectItem> items = fromItem.getSubQuery().getSelectClause().getItems();
    for (final SelectItem subQuerySelectItem : items) {
      select(new SelectItem(subQuerySelectItem, fromItem));
    }
  } else {
    throw new MetaModelException("All select items ('*') not determinable with from item: " + fromItem);
  }
  return this;
}

代码示例来源:origin: datacleaner/DataCleaner

public void initialize() {
  final Table table = _outputDataStreamJob.getOutputDataStream().getTable();
  final Query query = new Query();
  query.from(table).selectAll();
  final List<SelectItem> selectItems = query.getSelectClause().getItems();
  final ConsumeRowHandler consumeRowHandler = _publisher.createConsumeRowHandler();
  _outputRowCollector = new OutputDataStreamRowCollector(_publisher, selectItems, consumeRowHandler);
  final OutputDataStream outputDataStream = _outputDataStreamJob.getOutputDataStream();
  _component.initializeOutputDataStream(outputDataStream, query, _outputRowCollector);
  _publisher.getAnalysisListener()
      .rowProcessingBegin(_publisher.getAnalysisJob(), _publisher.getRowProcessingMetrics());
}

相关文章