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

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

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

Query.setMaxRows介绍

[英]Sets the maximum number of rows to be queried. If the result of the query yields more rows they should be discarded.
[中]

代码示例

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

@Override
public DataSet materializeMainSchemaTable(Table table,
    Column[] columns, int maxRows) {
  DataContext dc = getDataContext(table);
  Query q = new Query().select(columns).from(table);
  if (maxRows >= 0) {
    q.setMaxRows(maxRows);
  }
  return dc.executeQuery(q);
}

代码示例来源: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;
  }
}

相关文章