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

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

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

Table.getColumnByName介绍

[英]Convenience method for retrieving a column by it's name.
[中]按列名称检索列的便捷方法。

代码示例

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

  1. protected Column getDefaultMappedColumn(final InputColumn<?> inputColumn, final Table table) {
  2. // automatically select a column by name, if it exists
  3. return table.getColumnByName(inputColumn.getName());
  4. }

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

  1. @Override
  2. public FilterBuilder<RowUpdationBuilder> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. @Override
  2. public FilterBuilder<RowDeletionBuilder> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. @Override
  2. public void setSelectedItem(Object value) {
  3. if (value instanceof String) {
  4. if (_table == null) {
  5. // cannot string convert to column without a table.
  6. value = null;
  7. } else {
  8. value = _table.getColumnByName((String) value);
  9. }
  10. }
  11. super.setSelectedItem(value);
  12. }

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

  1. @Override
  2. public FilterBuilder<DeleteFrom> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. @Override
  2. public FilterBuilder<RowUpdationBuilder> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. @Override
  2. public FilterBuilder<Update> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. private static List<Column> getSimilarColumns(List<Column> columns, Table table) {
  2. return columns.stream()
  3. .map( col -> table.getColumnByName(col.getName()))
  4. .collect(Collectors.toList());
  5. }

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

  1. @Override
  2. public FilterBuilder<RowDeletionBuilder> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. private static List<Column> getSimilarColumns(List<Column> columns, Table table) {
  2. return columns.stream()
  3. .map( col -> table.getColumnByName(col.getName()))
  4. .collect(Collectors.toList());
  5. }

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

  1. @Override
  2. public FilterBuilder<DeleteFrom> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. @Override
  2. public FilterBuilder<Update> where(String columnName) {
  3. Column column = _table.getColumnByName(columnName);
  4. if (column == null) {
  5. throw new IllegalArgumentException("No such column: " + columnName);
  6. }
  7. return where(column);
  8. }

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

  1. protected Column getDefaultMappedColumn(final InputColumn<?> inputColumn, final Table table) {
  2. // automatically select a column by name, if it exists
  3. return table.getColumnByName(inputColumn.getName());
  4. }

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

  1. public Column[] convertToColumns(final String schemaName, final String tableName, final String[] columnNames) {
  2. if (columnNames == null) {
  3. return null;
  4. }
  5. if (columnNames.length == 0) {
  6. return new Column[0];
  7. }
  8. final Table table = convertToTable(schemaName, tableName);
  9. final Column[] columns = new Column[columnNames.length];
  10. for (int i = 0; i < columns.length; i++) {
  11. columns[i] = table.getColumnByName(columnNames[i]);
  12. }
  13. return columns;
  14. }

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

  1. @Override
  2. public SatisfiedFromBuilder on(String left, String right) throws IllegalArgumentException {
  3. Table leftTable = leftItem.getTable();
  4. if (leftTable == null) {
  5. throw new IllegalArgumentException("Left side of join is not a Table, cannot resolve ON item: '" + left + "'.");
  6. }
  7. Table rightTable = rightItem.getTable();
  8. if (rightTable == null) {
  9. throw new IllegalArgumentException("Right side of join is not a Table, cannot resolve ON item: '" + right + "'.");
  10. }
  11. Column leftColumn = leftTable.getColumnByName(left);
  12. Column rightColumn = rightTable.getColumnByName(right);
  13. return on(leftColumn, rightColumn);
  14. }

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

  1. @Override
  2. public SatisfiedFromBuilder on(String left, String right) throws IllegalArgumentException {
  3. Table leftTable = leftItem.getTable();
  4. if (leftTable == null) {
  5. throw new IllegalArgumentException("Left side of join is not a Table, cannot resolve ON item: '" + left + "'.");
  6. }
  7. Table rightTable = rightItem.getTable();
  8. if (rightTable == null) {
  9. throw new IllegalArgumentException("Right side of join is not a Table, cannot resolve ON item: '" + right + "'.");
  10. }
  11. Column leftColumn = leftTable.getColumnByName(left);
  12. Column rightColumn = rightTable.getColumnByName(right);
  13. return on(leftColumn, rightColumn);
  14. }

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

  1. @Override
  2. public FilterBuilder<RowDeletionBuilder> where(String columnName) {
  3. Column column = getTable().getColumnByName(columnName);
  4. return where(column);
  5. }

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

  1. @Override
  2. public FilterBuilder<RowUpdationBuilder> where(String columnName) {
  3. Column column = getTable().getColumnByName(columnName);
  4. return where(column);
  5. }

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

  1. @Override
  2. public FilterBuilder<RowUpdationBuilder> where(String columnName) {
  3. Column column = getTable().getColumnByName(columnName);
  4. return where(column);
  5. }

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

  1. @Override
  2. public FilterBuilder<RowDeletionBuilder> where(String columnName) {
  3. Column column = getTable().getColumnByName(columnName);
  4. return where(column);
  5. }

相关文章