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


Java ResultQuery.fetchLazy方法代码示例

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


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

示例1: fetchList

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> fetchList (ResultQuery<Record1<String>> query, String columnField) {
  Cursor<Record1<String>> cursor = null;
  List<String> result = new ArrayList<String> (1000);
  try {
    cursor = query.fetchLazy ();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext ()) {
      Record record = cursor.fetchOne ();
      String sValue = (String) record.getValue (columnField);
      result.add (sValue);
    }
  } finally {
    if (cursor != null) {
      cursor.close ();
    }
  }
  return result;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:19,代码来源:TestJooqCursorLUSCLevel2.java

示例2: testSimpleSelectAll

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test
@Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
  Table<Record> table = tableByName (tsvFileName);

  long startTime = System.nanoTime ();
  int count = 0;
  ResultQuery<Record> query = context.selectFrom (table);
  // log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());
  Cursor<Record> cursor = null;
  try {
    cursor = query.fetchLazy ();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext ()) {
      Record record = cursor.fetchOne ();
      for (Field<?> columnField : record.fields ()) {
        String value = (String) record.getValue (columnField);
        count++;
      }
    }
  } finally {
    if (cursor != null) {
      cursor.close ();
    }
  }

  long endTime = System.nanoTime ();
  long duration = endTime - startTime;
  log.debug ("flat-count:" + count + ", duration: " + duration);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:31,代码来源:TestJooqCursorLUSCLevel2.java

示例3: read

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private int read (ResultQuery<Record> query) {
  Cursor<Record> cursor = null;
  int count = 0;
  try {
    cursor = query.fetchLazy ();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext ()) {
      Record record = cursor.fetchOne ();
      for (Field<?> columnField : record.fields ()) {
        String sValue = (String) record.getValue (columnField);
        @SuppressWarnings("unused") double value = NaN;
        if ("Inf".equalsIgnoreCase (sValue))
          value = POSITIVE_INFINITY;
        else if ("-Inf".equalsIgnoreCase (sValue))
          value = NEGATIVE_INFINITY;
        else if ("NA".equalsIgnoreCase (sValue))
          value = NaN;
        else if ("null".equalsIgnoreCase (sValue))
          value = NaN;
        else if (sValue == null)
          value = NaN;
        else
          value = Double.parseDouble (sValue);
        count++;
      }
    }
  } finally {
    if (cursor != null) {
      cursor.close ();
    }
  }
  return count;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:34,代码来源:TestJooqCursorLUSCLevel2.java

示例4: testSimpleSelectAll

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test @Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
  String tsvFileName="LGG.AgilentG4502A_07_3.Level_2.tsv";
  Table<Record> table = tableByName (tsvFileName);

  long startTime = System.nanoTime();
  int count=0;
  ResultQuery<Record> query =context.selectFrom (table);            
//  log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());      
  Cursor<Record> cursor = null;
  try {
    cursor = query.fetchLazy();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext()) {
        Record record = cursor.fetchOne();
        for(Field<?> columnField: record.fields()){
          String value = (String)record.getValue (columnField);
          count++;
        }
    }
  }finally {
    if (cursor != null) {cursor.close();}
  }
  
  long endTime = System.nanoTime();
  long duration = endTime - startTime;
  log.debug ("flat-count:"+count+", duration: "+duration);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:29,代码来源:TestJooqCursorLGGLevel2.java

示例5: read

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private int read(ResultQuery<Record> query){
  Cursor<Record> cursor = null;
  int count=0;
  try {
    cursor = query.fetchLazy();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext()) {
        Record record = cursor.fetchOne();
        for(Field<?> columnField: record.fields()){
          String sValue = (String)record.getValue (columnField);
          @SuppressWarnings("unused") double value=NaN;
          if ("Inf".equalsIgnoreCase (sValue))
            value = POSITIVE_INFINITY;
          else if ("-Inf".equalsIgnoreCase (sValue))
            value = NEGATIVE_INFINITY;
          else if ("NA".equalsIgnoreCase (sValue))
            value = NaN;
          else if ("null".equalsIgnoreCase (sValue))
            value = NaN;
          else if (sValue==null)
            value = NaN;
          else
            value = Double.parseDouble (sValue);            
          count++;
        }
    }
  }finally {
    if (cursor != null) {cursor.close();}
  }
  return count;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:32,代码来源:TestJooqCursorLGGLevel2.java

示例6: testSimpleSelectAll

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test
@Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
  Table<Record> table = tableByName (tsvFileName);    

  long startTime = System.nanoTime ();
  int count = 0;
  ResultQuery<Record> query = context.selectFrom (table);
  // log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());
  Cursor<Record> cursor = null;
  try {
    cursor = query.fetchLazy ();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext ()) {
      Record record = cursor.fetchOne ();
      for (Field<?> columnField : record.fields ()) {
        String value = (String) record.getValue (columnField);
        count++;
      }
    }
  } finally {
    if (cursor != null) {
      cursor.close ();
    }
  }

  long endTime = System.nanoTime ();
  long duration = endTime - startTime;
  log.debug ("flat-count:" + count + ", duration: " + duration);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:31,代码来源:TestJooqCursorGBMLevel2.java

示例7: read

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private int read (ResultQuery<Record> query) {
  Cursor<Record> cursor = null;
  int count = 0;
  try {
    cursor = query.fetchLazy ();
    // Cursor has similar methods as Iterator<R>
    while (cursor.hasNext ()) {
      Record record = cursor.fetchOne ();
      for (Field<?> columnField : record.fields ()) {
        String sValue = (String) record.getValue (columnField);
        double value = NaN;
        if ("Inf".equalsIgnoreCase (sValue))
          value = POSITIVE_INFINITY;
        else if ("-Inf".equalsIgnoreCase (sValue))
          value = NEGATIVE_INFINITY;
        else if ("NA".equalsIgnoreCase (sValue))
          value = NaN;
        else if ("null".equalsIgnoreCase (sValue))
          value = NaN;
        else if (sValue == null)
          value = NaN;
        else
          value = Double.parseDouble (sValue);
        count++;
      }
    }
  } finally {
    if (cursor != null) {
      cursor.close ();
    }
  }
  return count;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:35,代码来源:TestJooqCursorGBMLevel2.java

示例8: openCursor

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private Cursor<Record> openCursor(){
      Timer timer = Timer.start ("open-cursor");
      Cursor<Record> cursor;
      ResultQuery<Record> query=null;
      try{
//        query = queryHelper.queryAllRows (fieldList, table);
        query = queryHelper.queryINRows (fieldList, rows.keys (), table);
        cursor = query.fetchLazy ();
      }finally{
        if(query!=null) query.close();            
      }
      timer.read ();
      return cursor;
    }
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:15,代码来源:PresetValuesFlatTableIterable.java


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