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

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

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

Query.selectDistinct介绍

暂无

代码示例

代码示例来源:origin: org.eobjects.analyzerbeans/AnalyzerBeans-core

@Override
  public Collection<String> getValues() {
    try (final DatastoreConnection con = _datastore.openConnection()) {
      final DataContext dataContext = con.getDataContext();

      final Query q = dataContext.query().from(_column.getTable()).select(_column).toQuery();
      q.selectDistinct();

      try (final DataSet dataSet = dataContext.executeQuery(q)) {
        final List<String> values = new ArrayList<String>();
        while (dataSet.next()) {
          final Row row = dataSet.getRow();
          
          Object value = row.getValue(0);
          if (value != null) {
            value = value.toString();
          }
          values.add((String) value);
        }
        return values;
      }
    }
  }
}

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

query.selectDistinct();
selectClause = selectClause.substring("DISTINCT ".length());

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

query.selectDistinct();
selectClause = selectClause.substring("DISTINCT ".length());

相关文章