Lateral(Table<R> table) { super(table.getName(), table.getSchema()); this.table = table; }
Lateral(Table<R> table) { super(table.getName(), table.getSchema()); this.table = table; }
TableAlias(Table<R> table, String alias, String[] fieldAliases, boolean wrapInParentheses) { super(alias, table.getSchema()); this.alias = new Alias<Table<R>>(table, alias, fieldAliases, wrapInParentheses); this.aliasedFields = init(fieldAliases); }
TableAlias(Table<R> table, Name alias, Name[] fieldAliases, boolean wrapInParentheses) { super(alias, table.getSchema()); this.alias = new Alias<Table<R>>(table, this, alias, fieldAliases, wrapInParentheses); this.aliasedFields = init(fieldAliases); }
public boolean isSemanticallyEquals(Table<Record> table) { if (!table.getName().equals(getName())) { return false; } if (table.getSchema() == null || !getSchema().getName().equals(table.getSchema().getName())) { return false; } if (table.fields().length != 7) { return false; } return true; //TODO: improve the check }
static final InformationSchema exportTables(Configuration configuration, List<Table<?>> tables) { InformationSchema result = new InformationSchema(); Set<Catalog> includedCatalogs = new LinkedHashSet<Catalog>(); Set<Schema> includedSchemas = new LinkedHashSet<Schema>(); Set<Table<?>> includedTables = new LinkedHashSet<Table<?>>(tables); for (Table<?> t : tables) includedSchemas.add(t.getSchema()); for (Schema s : includedSchemas) includedCatalogs.add(s.getCatalog()); for (Catalog c : includedCatalogs) exportCatalog0(result, c); for (Schema s : includedSchemas) exportSchema0(result, s); for (Table<?> t : tables) exportTable0(configuration, result, t, includedTables); return result; }
RenamedTable(Table<R> delegate, String rename) { super(rename, delegate.getSchema()); for (Field<?> field : delegate.fields()) { createField(field.getName(), field.getDataType(), this); } } }
Schema schema = table.getSchema();
@Override public Result<Record> run(DatabaseMetaData meta) throws SQLException { ResultSet rs = meta.getExportedKeys(null, pkTable.getSchema().getName(), pkTable.getName()); return ctx.fetch( rs, String.class, // PKTABLE_CAT String.class, // PKTABLE_SCHEM String.class, // PKTABLE_NAME String.class, // PKCOLUMN_NAME String.class, // FKTABLE_CAT String.class, // FKTABLE_SCHEM String.class, // FKTABLE_NAME String.class, // FKCOLUMN_NAME Short.class, // KEY_SEQ Short.class, // UPDATE_RULE Short.class, // DELETE_RULE String.class, // FK_NAME String.class // PK_NAME ); } });
Schema schema = table.getSchema();
@Override public String getSchemaName(int column) throws SQLException { rs.checkNotClosed(); Field<?> field = rs.result.field(column - 1); if (field instanceof TableField) { Table<?> table = ((TableField<?, ?>) field).getTable(); if (table != null) { Schema schema = table.getSchema(); if (schema != null) { Configuration configuration = rs.result.configuration(); Schema mapped = null; if (configuration != null) mapped = DSL.using(configuration).map(schema); if (mapped != null) return mapped.getName(); else return schema.getName(); } } } // By default, no schema is available return ""; }
@Override public String getSchemaName(int column) throws SQLException { rs.checkNotClosed(); Field<?> field = rs.result.field(column - 1); if (field instanceof TableField) { Table<?> table = ((TableField<?, ?>) field).getTable(); if (table != null) { Schema schema = table.getSchema(); if (schema != null) { Configuration configuration = ((AttachableInternal) rs.result).configuration(); Schema mapped = null; if (configuration != null) { mapped = DSL.using(configuration).map(schema); } if (mapped != null) { return mapped.getName(); } else { return schema.getName(); } } } } // By default, no schema is available return ""; }
String schemaName = t.getSchema().getName();