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

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

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

Table.getColumns介绍

[英]Gets the columns of this table.
[中]获取此表的列。

代码示例

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

  1. @Override
  2. public List<Column> getColumns() {
  3. return aliasedTable.getColumns();
  4. }

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

  1. public Column[] getColumns() {
  2. if (_columns == null) {
  3. return _table.getColumns().toArray(new Column[0]);
  4. }
  5. return _columns;
  6. }

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

  1. private List<Map<String, Object>> createColumnList(Table table) {
  2. List<Map<String, Object>> columns = new ArrayList<>();
  3. for (Column column : table.getColumns()) {
  4. columns.add(createColumnMap(column));
  5. }
  6. return columns;
  7. }

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

  1. /**
  2. * toggles whether or not the column is in the source selection
  3. */
  4. public void removeTable(final Table table) {
  5. final List<Column> columns = table.getColumns();
  6. for (final Column column : columns) {
  7. _analysisJobBuilder.removeSourceColumn(column);
  8. }
  9. }
  10. }

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

  1. @Override
  2. protected Void doInBackground() throws Exception {
  3. final Table table = (Table) _tableNode.getUserObject();
  4. final List<Column> columns = table.getColumns();
  5. for (final Column column : columns) {
  6. final String name = column.getName();
  7. logger.debug("Publishing column name: {}", name);
  8. publish(column);
  9. }
  10. return null;
  11. }

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

  1. public static DataSet getDataSet(Workbook workbook, Sheet sheet, Table table, ExcelConfiguration configuration) {
  2. final List<SelectItem> selectItems =
  3. table.getColumns().stream().map(SelectItem::new).collect(Collectors.toList());
  4. final Iterator<Row> rowIterator = getRowIterator(sheet, configuration, true);
  5. if (!rowIterator.hasNext()) {
  6. // no more rows!
  7. FileHelper.safeClose(workbook);
  8. return new EmptyDataSet(selectItems);
  9. }
  10. final DataSet dataSet = new XlsDataSet(selectItems, workbook, rowIterator);
  11. return dataSet;
  12. }
  13. }

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

  1. /**
  2. * toggles whether or not the column is in the source selection
  3. */
  4. public void addTable(final Table table) {
  5. final List<Column> columns = table.getColumns();
  6. for (final Column column : columns) {
  7. if (!_analysisJobBuilder.containsSourceColumn(column)) {
  8. _analysisJobBuilder.addSourceColumn(column);
  9. }
  10. }
  11. }

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

  1. @Override
  2. public TableCreationBuilder like(Table table) {
  3. logger.debug("like({})", table);
  4. List<Column> columns = table.getColumns();
  5. for (Column column : columns) {
  6. withColumn(column.getName()).like(column);
  7. }
  8. return this;
  9. }

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

  1. @Override
  2. public TableCreationBuilder like(Table table) {
  3. logger.debug("like({})", table);
  4. List<Column> columns = table.getColumns();
  5. for (Column column : columns) {
  6. withColumn(column.getName()).like(column);
  7. }
  8. return this;
  9. }

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

  1. protected ImmutableTable(Table table, ImmutableSchema schema) {
  2. this(table.getName(), table.getType(), schema, table.getRemarks(),
  3. table.getQuote());
  4. List<Column> origColumns = table.getColumns();
  5. for (Column column : origColumns) {
  6. columns.add(new ImmutableColumn(column, this));
  7. }
  8. }

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

  1. protected ImmutableTable(Table table, ImmutableSchema schema) {
  2. this(table.getName(), table.getType(), schema, table.getRemarks(),
  3. table.getQuote());
  4. List<Column> origColumns = table.getColumns();
  5. for (Column column : origColumns) {
  6. columns.add(new ImmutableColumn(column, this));
  7. }
  8. }

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

  1. public Schema toSerializableForm() {
  2. for (Table table : getTables()) {
  3. table.getColumns();
  4. table.getIndexedColumns();
  5. table.getPrimaryKeys();
  6. }
  7. loadRelations();
  8. return this;
  9. }

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

  1. public List<Column> getColumns() {
  2. if (_columns == null) {
  3. try (DatastoreConnection openConnection = _jsonDatastore.openConnection()) {
  4. _columns = openConnection.getDataContext().getDefaultSchema().getTable(0).getColumns();
  5. }
  6. }
  7. return _columns;
  8. }
  9. }

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

  1. @Override
  2. protected DataSet materializeMainSchemaTable(final Table table, final List<Column> columns, final int maxRows) {
  3. final SelectItem[] tableSelectItems = MetaModelHelper.createSelectItems(table.getColumns().toArray(new Column[0]));
  4. final SelectItem[] selectItems = MetaModelHelper.createSelectItems(columns.toArray(new Column[0]));
  5. final SimpleDataSetHeader header = new SimpleDataSetHeader(tableSelectItems);
  6. final List<Row> rows = new ArrayList<>();
  7. final SimpleDataSetHeader subSelectionHeader = new SimpleDataSetHeader(selectItems);
  8. rows.add(new DefaultRow(header, new Object[] { 1, "hello" }).getSubSelection(subSelectionHeader));
  9. rows.add(new DefaultRow(header, new Object[] { 2, "there" }).getSubSelection(subSelectionHeader));
  10. rows.add(new DefaultRow(header, new Object[] { 3, "big" }).getSubSelection(subSelectionHeader));
  11. rows.add(new DefaultRow(header, new Object[] { 4, "wide" }).getSubSelection(subSelectionHeader));
  12. rows.add(new DefaultRow(header, new Object[] { 5, "world" }).getSubSelection(subSelectionHeader));
  13. return new InMemoryDataSet(rows);
  14. }

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

  1. public Schema toSerializableForm() {
  2. for (Table table : getTables()) {
  3. table.getColumns();
  4. table.getIndexedColumns();
  5. table.getPrimaryKeys();
  6. }
  7. loadRelations();
  8. return this;
  9. }

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

  1. @Override
  2. public OutputDataStreamBuilder likeTable(final Table table) {
  3. final List<Column> existingColumns = _table.getColumns();
  4. for (final Column column : existingColumns) {
  5. _table.removeColumn(column);
  6. }
  7. final List<Column> newColumns = table.getColumns();
  8. for (final Column column : newColumns) {
  9. withColumn(column.getName(), column.getType());
  10. }
  11. return this;
  12. }

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

  1. private void addTableToSource(final DatastoreConnection con) {
  2. if (con != null) {
  3. final Schema defaultSchema = con.getSchemaNavigator().getDefaultSchema();
  4. final int datastoreSize = defaultSchema.getTableCount();
  5. if (datastoreSize == 1) {
  6. final List<Column> columns = defaultSchema.getTable(0).getColumns();
  7. _analysisJobBuilder.addSourceColumns(columns);
  8. }
  9. }
  10. }

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

  1. @Override
  2. protected RowProcessingQueryOptimizer getQueryOptimizer() {
  3. final Table table = getStream().getTable();
  4. final Query q = new Query().from(table).select(table.getColumns());
  5. return new NoopRowProcessingQueryOptimizer(q, getConsumersSorted());
  6. }
  7. }

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

  1. protected List<Row> getRowsToUpdate() {
  2. final DataContext dc = _updateCallback.getDataContext();
  3. final Table table = getTable();
  4. final List<FilterItem> whereItems = getWhereItems();
  5. final DataSet dataSet = dc.query()
  6. .from(table)
  7. .select(table.getColumns())
  8. .where(whereItems).execute();
  9. final List<Row> rows = dataSet.toRows();
  10. return rows;
  11. }

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

  1. protected List<Row> getRowsToUpdate() {
  2. final DataContext dc = _updateCallback.getDataContext();
  3. final Table table = getTable();
  4. final List<FilterItem> whereItems = getWhereItems();
  5. final DataSet dataSet = dc.query()
  6. .from(table)
  7. .select(table.getColumns())
  8. .where(whereItems).execute();
  9. final List<Row> rows = dataSet.toRows();
  10. return rows;
  11. }

相关文章