org.apache.metamodel.schema.Table.getColumn()方法的使用及代码示例

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

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

Table.getColumn介绍

[英]Gets a column by index. Use #getColumnCount() to get the (0-based) index range.
[中]按索引获取列。使用#getColumnCount()获取(基于0的)索引范围。

代码示例

代码示例来源:origin: org.apache.metamodel/MetaModel-core

/**
 * Constructs a {@link SimpleTableDef} using a {@link Table} as a prototype.
 * 
 * @param table
 */
public SimpleTableDef(Table table) {
  _name = table.getName();
  _columnNames = new String[table.getColumnCount()];
  _columnTypes = new ColumnType[table.getColumnCount()];
  for (int i = 0; i < table.getColumnCount(); i++) {
    Column column = table.getColumn(i);
    _columnNames[i] = column.getName();
    _columnTypes[i] = column.getType();
  }
}

代码示例来源:origin: apache/metamodel

/**
 * Constructs a {@link SimpleTableDef} using a {@link Table} as a prototype.
 * 
 * @param table
 */
public SimpleTableDef(Table table) {
  _name = table.getName();
  _columnNames = new String[table.getColumnCount()];
  _columnTypes = new ColumnType[table.getColumnCount()];
  for (int i = 0; i < table.getColumnCount(); i++) {
    Column column = table.getColumn(i);
    _columnNames[i] = column.getName();
    _columnTypes[i] = column.getType();
  }
}

代码示例来源:origin: datacleaner/DataCleaner

private SimpleTableDef createTableDef(final Table table) {
  final int columnCount = table.getColumnCount();
  final String[] names = new String[columnCount];
  final ColumnType[] types = new ColumnType[columnCount];
  for (int i = 0; i < columnCount; i++) {
    names[i] = table.getColumn(i).getName();
    types[i] = table.getColumn(i).getType();
  }
  return new SimpleTableDef(table.getName(), names, types);
}

相关文章