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


Java ResultQuery.fetchOne方法代码示例

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


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

示例1: getColumnKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> getColumnKeys(String tableName, String fieldRowIdName){
  //get columns
  Table<Record> table = tableByName (tableName);    
  Timer timer = Timer.start ("get-column-keys");
  ResultQuery<Record> queryColumnKeys =context.selectFrom(table).limit (1) .getQuery ();
  Record recordColumnKeys = queryColumnKeys.fetchOne ();
  List<String> columns = new ArrayList<String>();
  for(Field<?> field : recordColumnKeys.fields())
    if(!field.getName ().equals (ID_FIELD_NAME))
      columns.add (field.getName ());
  
  if(log.isDebugEnabled ()){
    timer.read();
    log.debug ("columns.size(): " + columns.size ());
    log.debug ("columns: " + columns);
  }
  return columns;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:19,代码来源:PresetDimensionBuilderFlatTable.java

示例2: getColumnKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> getColumnKeys (String tableName, String fieldRowIdName) {
  // get columns
  Table<Record> table = tableByName (tableName);
  Timer timer = Timer.start ("get-column-keys");
  ResultQuery<Record> queryColumnKeys = context.selectFrom (table).limit (1).getQuery ();
  Record recordColumnKeys = queryColumnKeys.fetchOne ();
  List<String> columns = new ArrayList<String> ();
  for (Field<?> field : recordColumnKeys.fields ())
    if (!field.getName ().equals (ID_FIELD_NAME))
      columns.add (field.getName ());
  timer.read ();
  log.debug ("columns.size(): " + columns.size ());
  log.debug ("columns: " + columns);
  return columns;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:16,代码来源:TestJooqCursorLUSCLevel2.java

示例3: getColumnKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> getColumnKeys(String tableName, String fieldRowIdName){
  //get columns
  Table<Record> table = tableByName (tableName);    
  Timer timer = Timer.start ("get-column-keys");
  ResultQuery<Record> queryColumnKeys =context.selectFrom(table).limit (1) .getQuery ();
  Record recordColumnKeys = queryColumnKeys.fetchOne ();
  List<String> columns = new ArrayList<String>();
  for(Field<?> field : recordColumnKeys.fields())
    if(!field.getName ().equals (ID_FIELD_NAME))
      columns.add (field.getName ());    
  timer.read();
  log.debug ("columns.size(): " + columns.size ());
  log.debug ("columns: " + columns);
  return columns;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:16,代码来源:TestJooqCursorLGGLevel2.java

示例4: getColumnKeys

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> getColumnKeys (String tableName, String fieldRowIdName) {
  // get columns
  Table<Record> table = tableByName (tableName);    
  Timer timer = Timer.start ("get-column-keys");
  ResultQuery<Record> queryColumnKeys = context.selectFrom (table).limit (1).getQuery ();
  Record recordColumnKeys = queryColumnKeys.fetchOne ();
  List<String> columns = new ArrayList<String> ();
  for (Field<?> field : recordColumnKeys.fields ())
    if (!field.getName ().equals (ID_FIELD_NAME))
      columns.add (field.getName ());
  timer.read ();
  log.debug ("columns.size(): " + columns.size ());
  log.debug ("columns: " + columns);
  return columns;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:16,代码来源:TestJooqCursorGBMLevel2.java

示例5: getInternal

import org.jooq.ResultQuery; //导入方法依赖的package包/类
private double getInternal (String row, String column) throws InvalidCoordinateException {
  try {
    
    ResultQuery<?> query=null;
    if(!isSameRecord (row)){        
      try{
        query =queryHelper.queryValue (row, column, table, fieldRowId);
      //  log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());      
        Record record = query.fetchOne ();          
        setLastRecord (record);
      }finally{
        if(query!=null) 
          query.close();            
      }
    } 
    String value = (String)this.lastMap.get(column);
    
    if ("Inf".equalsIgnoreCase (value))
      return POSITIVE_INFINITY;
    else if ("-Inf".equalsIgnoreCase (value))
      return NEGATIVE_INFINITY;
    else if ("NA".equalsIgnoreCase (value))
      return NaN;
    else if ("null".equalsIgnoreCase (value))
      return NaN;
    else if (value==null)
      return NaN;
    else{
      return Double.parseDouble (value);        
    }
    
  } catch (RuntimeException e) {
    throw new RuntimeException (" Failed to fetch row " + row + ", column " + column + " from " + table, e);
  }
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:36,代码来源:PresetValuesFlatTableIterable.java

示例6: get

import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Override
  public double get (String row, String column) throws InvalidCoordinateException {
    try {
      Field<String> columnField = fieldByName (String.class, column.toUpperCase ());
      ResultQuery<Record> query=null;
      if(!isSameRecord (row)){        
        try{
          query =context.selectFrom (table)
                  .where (this.rowIdField.eq (row));
          log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());      
          Record record = query.fetchOne ();
          
  //        Record record=null;
  //        Cursor<Record> cursor = null;
  //        try {
  //          cursor = context.selectFrom (table).fetchLazy ();
  //          // Cursor has similar methods as Iterator<R>
  //          if(cursor.hasNext ()) {
  //            record = cursor.fetchOne ();              
  //          }
  //        } finally {
  //          if (cursor != null) {
  //            cursor.close ();
  //          }
  //        }
          setLastRecord (record);
        }finally{
          if(query!=null) 
            query.close();            
        }
      } 
//      String value = (String)this.lastMap.get(column);
      String value = (String)this.lastRecord.getValue (columnField);
      
      if ("Inf".equalsIgnoreCase (value))
        return POSITIVE_INFINITY;
      else if ("-Inf".equalsIgnoreCase (value))
        return NEGATIVE_INFINITY;
      else if ("NA".equalsIgnoreCase (value))
        return NaN;
      else if ("null".equalsIgnoreCase (value))
        return NaN;
      else if (value==null)
        return NaN;
      else
        return Double.parseDouble (value);
      
    } catch (RuntimeException e) {
      throw new RuntimeException (" Failed to fetch row " + row + ", column " + column + " from " + table, e);
    }
  }
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:52,代码来源:PresetValuesFlatTable.java


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