本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}