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

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

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

Table.getColumnNames介绍

[英]Gets the names of this table's columns.
[中]获取此表的列的名称。

代码示例

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

  1. @Override
  2. protected void writeHeader(final Writer writer) throws IOException {
  3. final List<String> headers = new ArrayList<>(table.getColumnNames());
  4. if (!_isColumnToBeSortedOnPresentInInput) {
  5. headers.remove(columnToBeSortedOn.getName());
  6. }
  7. final String[] columnNames = headers.toArray(new String[0]);
  8. final String line = csvWriter.buildLine(columnNames);
  9. writer.write(line);
  10. }

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

  1. @Override
  2. protected void writeHeader(final ExcelDataContextWriter writer) throws IOException {
  3. final List<String> headers = new ArrayList<>(table.getColumnNames());
  4. if (!isColumnToBeSortedOnPresentInInput) {
  5. headers.remove(columnToBeSortedOn.getName());
  6. }
  7. writer.createTable(headers);
  8. }

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

  1. final List<String> columnNames2 = other.getColumnNames();

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

  1. final List<String> columnNames2 = other.getColumnNames();

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

  1. final List<String> outputStreamColumnNames = table.getColumnNames();
  2. if (!sourceColumnsNames.equals(outputStreamColumnNames)) {

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

  1. if (table != null) {
  2. logger.debug("Table available in FROM item: {}. Column names: {}", table, Arrays.toString(table
  3. .getColumnNames().toArray()));

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

  1. if (table != null) {
  2. logger.debug("Table available in FROM item: {}. Column names: {}", table, Arrays.toString(table
  3. .getColumnNames().toArray()));

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

  1. write("No such table: " + tableName);
  2. } else {
  3. final List<String> columnNames = table.getColumnNames();
  4. write("Columns:");
  5. write("--------");

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

  1. final Table table = testDataContext.getDefaultSchema().getTable(0);
  2. if (_columnNames == null) {
  3. _columnNames = testDataContext.getDefaultSchema().getTable(0).getColumnNames();

代码示例来源:origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  1. @Override
  2. public List<ColumnIdentifier> getColumns(final TenantIdentifier tenant, final TableIdentifier tableId) {
  3. final SchemaIdentifier schemaId = tableId.getSchema();
  4. final TenantContext tenantContext = _tenantContextFactory.getContext(tenant);
  5. final Datastore datastore = tenantContext.getDatastore(schemaId.getDatastore());
  6. if (datastore == null) {
  7. return null;
  8. }
  9. try (final DatastoreConnection con = datastore.openConnection()) {
  10. final Schema schema = con.getDataContext().getSchemaByName(schemaId.getName());
  11. final Table table = schema.getTableByName(tableId.getName());
  12. final String[] columnNames = table.getColumnNames();
  13. final List<ColumnIdentifier> columnIdentifiers = CollectionUtils.map(columnNames,
  14. new Func<String, ColumnIdentifier>() {
  15. @Override
  16. public ColumnIdentifier eval(String columnName) {
  17. return new ColumnIdentifier(tableId, columnName);
  18. }
  19. });
  20. return columnIdentifiers;
  21. }
  22. }
  23. }

相关文章