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

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

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

Table.getType介绍

[英]Gets the table type of this table.
[中]获取此表的表类型。

代码示例

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

  1. @Override
  2. public List<Table> getTables() {
  3. return delegates.stream()
  4. .flatMap(delegate -> delegate.getTables().stream())
  5. .filter(table -> table.getType() != TableType.ALIAS)
  6. .collect(Collectors.toList());
  7. }

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

  1. @Override
  2. public List<Table> getTables() {
  3. return delegates.stream()
  4. .flatMap(delegate -> delegate.getTables().stream())
  5. .filter(table -> table.getType() != TableType.ALIAS)
  6. .collect(Collectors.toList());
  7. }

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

  1. @Override
  2. public final List<Table> getTables(final TableType type) {
  3. return getTables().stream()
  4. .filter(table -> table.getType().equals(type))
  5. .collect(Collectors.toList());
  6. }

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

  1. @Override
  2. public final List<Table> getTables(final TableType type) {
  3. return getTables().stream()
  4. .filter(table -> table.getType().equals(type))
  5. .collect(Collectors.toList());
  6. }

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

  1. /**
  2. * Creates a SelectItem that references a column from a particular {@link FromItem}, for example a.price or p.age
  3. *
  4. * @param column
  5. * @param fromItem
  6. */
  7. public SelectItem(Column column, FromItem fromItem) {
  8. this(null, column, fromItem);
  9. if (fromItem != null) {
  10. Table fromItemTable = fromItem.getTable();
  11. if (fromItemTable != null && fromItemTable.getType() != TableType.ALIAS) {
  12. Table columnTable = column.getTable();
  13. if (columnTable != null && !columnTable.equals(fromItemTable)) {
  14. throw new IllegalArgumentException("Column's table '" + columnTable.getName()
  15. + "' is not equal to referenced table: " + fromItemTable);
  16. }
  17. }
  18. }
  19. }

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

  1. /**
  2. * Creates a SelectItem that references a column from a particular {@link FromItem}, for example a.price or p.age
  3. *
  4. * @param column
  5. * @param fromItem
  6. */
  7. public SelectItem(Column column, FromItem fromItem) {
  8. this(null, column, fromItem);
  9. if (fromItem != null) {
  10. Table fromItemTable = fromItem.getTable();
  11. if (fromItemTable != null && fromItemTable.getType() != TableType.ALIAS) {
  12. Table columnTable = column.getTable();
  13. if (columnTable != null && !columnTable.equals(fromItemTable)) {
  14. throw new IllegalArgumentException("Column's table '" + columnTable.getName()
  15. + "' is not equal to referenced table: " + fromItemTable);
  16. }
  17. }
  18. }
  19. }

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

  1. public Table convertToTable(final String schemaName, final String tableName) {
  2. final Schema schema;
  3. if (schemaName == null) {
  4. schema = getDefaultSchema();
  5. } else {
  6. schema = getSchemaByName(schemaName);
  7. }
  8. if (schema == null) {
  9. throw new IllegalArgumentException(
  10. "Schema " + schemaName + " not found. Available schema names are: " + dataContext.getSchemaNames());
  11. }
  12. final Table table;
  13. if (tableName == null) {
  14. if (schema.getTables().stream().filter(t -> t.getType() == TableType.TABLE).count() == 1) {
  15. table = schema.getTables().stream().filter(t -> t.getType() == TableType.TABLE).findFirst().get();
  16. } else {
  17. throw new IllegalArgumentException(
  18. "No table name specified, and multiple options exist. Available table names are: "
  19. + schema.getTableNames());
  20. }
  21. } else {
  22. table = schema.getTableByName(tableName);
  23. }
  24. if (table == null) {
  25. throw new IllegalArgumentException(
  26. "Table not found. Available table names are: " + schema.getTableNames());
  27. }
  28. return table;
  29. }

代码示例来源: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: datacleaner/DataCleaner

  1. private String getColumnPathQualification(final Datastore datastore,
  2. final Collection<InputColumn<?>> sourceColumns) {
  3. if (datastore == null || sourceColumns == null || sourceColumns.isEmpty()) {
  4. return COLUMN_PATH_QUALIFICATION_FULL;
  5. }
  6. try (DatastoreConnection connection = datastore.openConnection()) {
  7. final SchemaNavigator schemaNavigator = connection.getSchemaNavigator();
  8. final Schema[] schemas = schemaNavigator.getSchemas();
  9. Schema singleSchema = null;
  10. int realSchemas = 0;
  11. for (final Schema schema : schemas) {
  12. if (!MetaModelHelper.isInformationSchema(schema)) {
  13. realSchemas++;
  14. singleSchema = schema;
  15. }
  16. }
  17. if (realSchemas == 1) {
  18. final long tableCount =
  19. singleSchema.getTables().stream().filter(t -> t.getType() == TableType.TABLE).count();
  20. if (tableCount == 1L) {
  21. return COLUMN_PATH_QUALIFICATION_COLUMN;
  22. }
  23. return COLUMN_PATH_QUALIFICATION_TABLE;
  24. }
  25. return COLUMN_PATH_QUALIFICATION_FULL;
  26. }
  27. }

代码示例来源: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-core

  1. if (table == null && schema.getTables().stream().filter(t -> t.getType() != TableType.ALIAS).count() == 1) {
  2. table = schema.getTables().get(0);

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

  1. if (table == null && schema.getTables().stream().filter(t -> t.getType() != TableType.ALIAS).count() == 1) {
  2. table = schema.getTables().get(0);

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

  1. return false;
  2. if (getType() != other.getType()) {
  3. return false;

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

  1. return false;
  2. if (getType() != other.getType()) {
  3. return false;

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

  1. if (t.getType() != null) {
  2. typeString = t.getType().toString();
  3. for (Column c : t.getColumns()) {
  4. String typeString = null;
  5. if (t.getType() != null) {
  6. typeString = c.getType().toString();

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

  1. if (t.getType() != null) {
  2. typeString = t.getType().toString();
  3. for (Column c : t.getColumns()) {
  4. String typeString = null;
  5. if (t.getType() != null) {
  6. typeString = c.getType().toString();

相关文章