Java UpdateCallback Example

说明

java updatecallback示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Java

命名空间/包名称: org.apache.metamodel

示例#1
文件: InsertInto.java项目: narentera/metamodel

  @Override
  public void run(UpdateCallback callback) {
    RowInsertionBuilder insertBuilder = callback.insertInto(getTable());

    final Column[] columns = getColumns();
    final Object[] values = getValues();
    final Style[] styles = getStyles();
    final boolean[] explicitNulls = getExplicitNulls();

    for (int i = 0; i < columns.length; i++) {
      Object value = values[i];
      Column column = columns[i];
      Style style = styles[i];
      if (value == null) {
        if (explicitNulls[i]) {
          insertBuilder = insertBuilder.value(column, value, style);
        }
      } else {
        insertBuilder = insertBuilder.value(column, value, style);
      }
    }

    insertBuilder.execute();
  }

展开阅读全文