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

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

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

Query.select介绍

[英]Adds a selection to this query.
[中]

代码示例

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

/**
 * Adds a selection to this query.
 * 
 * @param expression
 * @return
 */
public Query select(String expression) {
  return select(expression, false);
}

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

/**
 * Adds a selection to this query.
 * 
 * @param expression
 * @return
 */
public Query select(String expression) {
  return select(expression, false);
}

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

@Override
public SatisfiedSelectBuilder<GroupedQueryBuilder> select(Column... columns) {
  if (columns == null) {
    throw new IllegalArgumentException("column cannot be null");
  }
  _query.select(columns);
  return new SatisfiedSelectBuilderImpl(this);
}

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

public FunctionSelectBuilderImpl(FunctionType functionType, Column column, Object[] functionParameters,
    Query query, GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = new SelectItem(functionType, functionParameters, column);
  query.select(selectItem);
}

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

public CountSelectBuilderImpl(Query query, GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = SelectItem.getCountAllItem();
  query.select(selectItem);
}

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

public FunctionSelectBuilderImpl(FunctionType functionType, Column column, Object[] functionParameters,
    Query query, GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = new SelectItem(functionType, functionParameters, column);
  query.select(selectItem);
}

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

public ColumnSelectBuilderImpl(Column column, Query query,
    GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = new SelectItem(column);
  query.select(selectItem);
}

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

public CountSelectBuilderImpl(Query query, GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = SelectItem.getCountAllItem();
  query.select(selectItem);
}

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

@Override
public SatisfiedSelectBuilder<GroupedQueryBuilder> select(Column... columns) {
  if (columns == null) {
    throw new IllegalArgumentException("column cannot be null");
  }
  _query.select(columns);
  return new SatisfiedSelectBuilderImpl(this);
}

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

public ColumnSelectBuilderImpl(Column column, Query query,
    GroupedQueryBuilder queryBuilder) {
  super(queryBuilder);
  this.selectItem = new SelectItem(column);
  query.select(selectItem);
}

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

public Query select(Column column, FromItem fromItem) {
  SelectItem selectItem = new SelectItem(column, fromItem);
  return select(selectItem);
}

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

@Override
public SatisfiedSelectBuilder<?> select(Column... columns) {
  if (columns == null) {
    throw new IllegalArgumentException("columns cannot be null");
  }
  query.select(columns);
  GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

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

@Override
public SatisfiedSelectBuilder<?> select(String selectExpression, boolean allowExpressionBasedSelectItem) {
  if (selectExpression == null) {
    throw new IllegalArgumentException("selectExpression cannot be null");
  }
  query.select(selectExpression, allowExpressionBasedSelectItem);
  final GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

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

@Override
public SatisfiedSelectBuilder<?> select(Column... columns) {
  if (columns == null) {
    throw new IllegalArgumentException("columns cannot be null");
  }
  query.select(columns);
  GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

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

@Override
public SatisfiedSelectBuilder<?> select(String selectExpression, boolean allowExpressionBasedSelectItem) {
  if (selectExpression == null) {
    throw new IllegalArgumentException("selectExpression cannot be null");
  }
  query.select(selectExpression, allowExpressionBasedSelectItem);
  final GroupedQueryBuilder queryBuilder = new GroupedQueryBuilderImpl(dataContext, query);
  return new SatisfiedSelectBuilderImpl(queryBuilder);
}

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

@Override
protected DataSet materializeMainSchemaTable(Table table, List<Column> columns,
    int maxRows) {
  // find the appropriate datacontext to execute a simple
  // table materialization query
  final DataContext dc = _dataContextRetrievalFunction.apply(table);
  final Query q = new Query().select(columns).from(table);
  if (maxRows >= 0) {
    q.setMaxRows(maxRows);
  }
  return dc.executeQuery(q);
}

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

@Override
protected DataSet materializeMainSchemaTable(Table table, List<Column> columns,
    int maxRows) {
  // find the appropriate datacontext to execute a simple
  // table materialization query
  final DataContext dc = _dataContextRetrievalFunction.apply(table);
  final Query q = new Query().select(columns).from(table);
  if (maxRows >= 0) {
    q.setMaxRows(maxRows);
  }
  return dc.executeQuery(q);
}

代码示例来源: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: datacleaner/DataCleaner

@Override
  protected RowProcessingQueryOptimizer getQueryOptimizer() {
    final Table table = getStream().getTable();
    final Query q = new Query().from(table).select(table.getColumns());

    return new NoopRowProcessingQueryOptimizer(q, getConsumersSorted());
  }
}

相关文章