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