com.healthmarketscience.jackcess.Table.addRow()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(256)

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

Table.addRow介绍

[英]Adds a single row to this table and writes it to disk. The values are expected to be given in the order that the Columns are listed by the #getColumns method. This is by default the storage order of the Columns in the database, however this order can be influenced by setting the ColumnOrder via Database#setColumnOrder prior to opening the Table. The #asRow method can be used to easily convert a row Map into the appropriate row array for this Table.

Note, if this table has an auto-number column, the value generated will be put back into the given row array (assuming the given row array is at least as long as the number of Columns in this Table).
[中]向该表中添加一行并将其写入磁盘。这些值应该按照#getColumns方法列出列的顺序给出。默认情况下,这是数据库中列的存储顺序,但是在打开表之前通过数据库#setColumnOrder设置ColumnOrder会影响此顺序。#asRow方法可用于轻松地将行映射转换为此表的适当行数组。
注意,如果此表有一个自动编号列,则生成的值将被放回给定的行数组中(假设给定的行数组至少与此表中的列数相同)。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

void addRowToTable( Object... row ) throws IOException {
 table.addRow( row );
}

代码示例来源:origin: net.sf.ucanaccess/ucanaccess

@Override
public Object[] addRow(Object... row) throws IOException {
  return wrapped.addRow(row);
}

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

@Override
public ComplexValue.Id addRawValue(Map<String,?> rawValue)
 throws IOException 
{
 Object[] row = ((TableImpl)_flatTable).asRowWithRowId(rawValue);
 _flatTable.addRow(row);
 return getValueId(row);
}

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

@Override
public ComplexValue.Id addValue(V value) throws IOException {
 Object[] row = asRow(newRowArray(), value);
 _flatTable.addRow(row);
 ComplexValue.Id id = getValueId(row);
 value.setId(id);
 return id;
}

代码示例来源:origin: net.sf.ucanaccess/ucanaccess

public void insertRow(Table _table, Object[] _row) throws IOException {
  try {
    _table.addRow(newRow);
  } catch (ConstraintViolationException e) {
    List<? extends Column> lc = _table.getColumns();
    boolean retry = false;
    for (Column cl : lc) {
      if (cl.isAutoNumber()) {
        retry = true;
        break;
      }
    }
    if (!retry) {
      throw e;
    }
    Database db = _table.getDatabase();
    File fl = db.getFile();
    DBReferenceSingleton dbsin = DBReferenceSingleton.getInstance();
    DBReference ref = dbsin.getReference(fl);
    ref.reloadDbIO();
    this.dbIO = ref.getDbIO();
    _table = this.dbIO.getTable(this.tableName);
    _table.addRow(newRow);
  }
}

代码示例来源:origin: ujmp/universal-java-matrix-package

data[c] = matrix.getAsObject(r, c);
table.addRow(data);

相关文章