当前位置: 首页>>代码示例>>Java>>正文


Java ResultQuery.fetchArray方法代码示例

本文整理汇总了Java中org.jooq.ResultQuery.fetchArray方法的典型用法代码示例。如果您正苦于以下问题:Java ResultQuery.fetchArray方法的具体用法?Java ResultQuery.fetchArray怎么用?Java ResultQuery.fetchArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jooq.ResultQuery的用法示例。


在下文中一共展示了ResultQuery.fetchArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRowKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Synchronized @SuppressWarnings("unused")
private List<String> getRowKeys (String tableName, String fieldRowIdName) {
  Timer timer = Timer.start ("get-row-keys");
  if (this.rowKeys == null) {
    Table<Record> table = tableByName (tableName);
    Field<String> fieldRowId = fieldByName (String.class, fieldRowIdName);
    // get rows
    Timer timer2 = Timer.start ("fetch-array");
    ResultQuery<Record1<String>> queryRowKeys = context.select (fieldRowId).from (table).getQuery ();
    String[] arows = queryRowKeys.fetchArray (fieldRowId);
    timer2.read ();
    // List<String> rows = Arrays.asList (arows);
    timer2 = Timer.start ("copy-array-to-list");
    // this.rowKeys = new ArrayList<String>(arows.length);
    // Collections.addAll (this.rowKeys, arows);
    // this.rowKeys = Arrays.asList (arows);
    this.rowKeys = fetchList (queryRowKeys, ID_FIELD_NAME);
    timer2.read ();

    log.debug ("rows.size(): " + this.rowKeys.size ());
  }
  timer.read ();
  return this.rowKeys;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:25,代码来源:TestJooqCursorLUSCLevel2.java

示例2: getRowKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Synchronized 
private List<String> getRowKeys(String tableName, String fieldRowIdName){
  if(rowCasche.containsKey (tableName)){
    return rowCasche.get (tableName);
  }else{
    
    Table<Record> table = tableByName (tableName);
    Field<String> fieldRowId = fieldByName (String.class, fieldRowIdName);
    //get rows
    Timer timer = Timer.start ("get-row-keys");      
    ResultQuery<Record1<String>> queryRowKeys =context.select(fieldRowId).from(table).orderBy (fieldRowId).getQuery ();      
    String[] arows = queryRowKeys.fetchArray (fieldRowId);
    timer.read ("fetch-array");
//    List<String> rows = Arrays.asList (arows);
    List<String> rows = new ArrayList<String>(arows.length);      
    Collections.addAll (rows, arows);
    timer.read ("collection");      
    if(log.isDebugEnabled ()){
      timer.read();
      log.debug ("rows.size(): " + rows.size ());
    }
    rowCasche.put (tableName, rows);
    return rows;
  }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:26,代码来源:PresetDimensionBuilderFlatTable.java

示例3: getRowKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> getRowKeys(String tableName, String fieldRowIdName){
    Table<Record> table = tableByName (tableName);
    Field<String> fieldRowId = fieldByName (String.class, fieldRowIdName);
    //get rows
    Timer timer = Timer.start ("get-row-keys");
    ResultQuery<Record1<String>> queryRowKeys =context.select(fieldRowId).from(table).getQuery ();
    String[] arows = queryRowKeys.fetchArray (fieldRowId);
//    List<String> rows = Arrays.asList (arows);
    List<String> rows = new ArrayList<String>(arows.length);
    Collections.addAll (rows, arows);
    timer.read();
    log.debug ("rows.size(): " + rows.size ());
    return rows;
  }
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:15,代码来源:TestJooqCursorLGGLevel2.java


注:本文中的org.jooq.ResultQuery.fetchArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。