org.jooq.Record.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.jooq.Record.setValue方法的一些代码示例,展示了Record.setValue的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.setValue方法的具体详情如下:
包路径:org.jooq.Record
类名称:Record
方法名:setValue

Record.setValue介绍

[英]Set a value into this record.

[#2211] Future versions of jOOQ might remove the #set(Field,Object) method. It is recommended to use #set(Field,Object) instead.
[中]在该记录中设置一个值。
[#2211]jOOQ的未来版本可能会删除#set(Field,Object)方法。建议改用#set(字段、对象)。

代码示例

代码示例来源:origin: my2iu/Jinq

private <K> void copyValueIntoRecord(T outputRecord, Record inputRecord, Field<K> field, int idx)
{
 outputRecord.setValue(field, inputRecord.getValue(idx, field.getConverter()));
}

代码示例来源:origin: stackoverflow.com

Record record = create.newRecord(Report.province_id, Report.week_number);
record.setValue(Report.province_id, 2);
record.setValue(Report.week_number, 42);
ReportRecord report = results.get(record);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
   * Extracted method to ensure generic type safety.
   */
  private final <T> void setValue(Record record, Field<T> field) {
    record.setValue(field, getValue(field));
  }
});

代码示例来源:origin: stackoverflow.com

BigInteger expected = BigInteger.valueOf(1234567);
DSLContext ctx = DSL.using(new MockConnection(c -> {
  Field<BigInteger> id = DSL.field("last_insert_id()", BigInteger.class);
  Record record = DSL.using(MYSQL).newRecord(id);
  record.setValue(id, expected);
  return new MockResult[] { new MockResult(record) };
}), SQLDialect.MYSQL);

assertEquals(expected, ctx.lastID());

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Type-safely set a value to a record
 */
static final <T> void setValue(Record target, Field<T> targetField, Object value) {
  target.setValue(targetField, targetField.getDataType().convert(value));
}

代码示例来源:origin: com.openle.module.lambda/lambda

private <K> void copyValueIntoRecord(T outputRecord, Record inputRecord, Field<K> field, int idx)
{
 outputRecord.setValue(field, inputRecord.getValue(idx, field.getConverter()));
}

代码示例来源:origin: org.jooq/jooq

@SuppressWarnings({ "rawtypes", "unchecked" })
private Record record(Configuration configuration, Routine<?> routine) {
  Record result = null;
  List<Field<?>> fields = new ArrayList<Field<?>>(1 + routine.getOutParameters().size());
  Parameter<?> returnParam = routine.getReturnParameter();
  if (returnParam != null)
    fields.add(field(name(returnParam.getName()), returnParam.getDataType()));
  for (Parameter<?> param : routine.getOutParameters())
    fields.add(field(name(param.getName()), param.getDataType()));
  if (fields.size() > 0) {
    result = DSL.using(configuration).newRecord(fields.toArray(new Field[0]));
    int i = 0;
    if (returnParam != null)
      result.setValue((Field) fields.get(i++), routine.getValue(returnParam));
    for (Parameter<?> param : routine.getOutParameters())
      result.setValue((Field) fields.get(i++), routine.getValue(param));
    result.changed(false);
  }
  return result;
}

相关文章