@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SchemaReference)) { return false; } final Schema other = (Schema) obj; return Objects.equals(catalogName, other.getCatalogName()) && Objects.equals(schemaName, other.getName()); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SchemaReference)) { return false; } final Schema other = (Schema) obj; return Objects.equals(catalogName, other.getCatalogName()) && Objects.equals(schemaName, other.getName()); }
final String dbObjectSchemaName = dbObject.getSchema().getName(); if (schemaName != null && !schemaName.equals(dbObjectSchemaName))
private void quoteFullName(final StringBuilder buffer, final Schema schema) { requireNonNull(buffer, "No buffer provided"); if (schema == null) { return; } final String catalogName = schema.getCatalogName(); final String schemaName = schema.getName(); final boolean hasCatalogName = !isBlank(catalogName); final boolean hasSchemaName = !isBlank(schemaName); if (hasCatalogName) { quoteName(buffer, catalogName); } if (hasCatalogName && hasSchemaName) { buffer.append("."); } if (hasSchemaName) { quoteName(buffer, schemaName); } }
private void quoteFullName(final StringBuilder buffer, final Schema schema) { requireNonNull(buffer, "No buffer provided"); if (schema == null) { return; } final String catalogName = schema.getCatalogName(); final String schemaName = schema.getName(); final boolean hasCatalogName = !isBlank(catalogName); final boolean hasSchemaName = !isBlank(schemaName); if (hasCatalogName) { quoteName(buffer, catalogName); } if (hasCatalogName && hasSchemaName) { buffer.append("."); } if (hasSchemaName) { quoteName(buffer, schemaName); } }
private void retrieveIndexesFromMetadata(final MutableTable table, final boolean unique) throws SQLException { try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getIndexInfo(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName(), unique, true/* approximate */));) { createIndexes(table, results); } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve indexes for table " + table, e); } }
private void retrieveIndexesFromMetadata(final MutableTable table, final boolean unique) throws SQLException { try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getIndexInfo(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName(), unique, true/* approximate */));) { createIndexes(table, results); } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve indexes for table " + table, e); } }
private void retrieveTableColumnsFromMetadata(final NamedObjectList<MutableTable> allTables, final InclusionRuleFilter<Column> columnFilter, final Set<List<String>> hiddenColumns) throws SchemaCrawlerSQLException { for (final MutableTable table: allTables) { LOGGER.log(Level.FINE, "Retrieving table columns for " + table); try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getColumns(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName(), null));) { while (results.next()) { createTableColumn(results, allTables, columnFilter, hiddenColumns); } } catch (final SQLException e) { throw new SchemaCrawlerSQLException(String .format("Could not retrieve table columns for %s <%s>", table.getTableType(), table), e); } } }
private void retrieveTableColumnsFromMetadata(final NamedObjectList<MutableTable> allTables, final InclusionRuleFilter<Column> columnFilter, final Set<List<String>> hiddenColumns) throws SchemaCrawlerSQLException { for (final MutableTable table: allTables) { LOGGER.log(Level.FINE, "Retrieving table columns for " + table); try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getColumns(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName(), null));) { while (results.next()) { createTableColumn(results, allTables, columnFilter, hiddenColumns); } } catch (final SQLException e) { throw new SchemaCrawlerSQLException(String .format("Could not retrieve table columns for %s <%s>", table.getTableType(), table), e); } } }
private void retrievePrimaryKeysFromMetadata(final NamedObjectList<MutableTable> allTables) throws SQLException { for (final MutableTable table: allTables) { if (table instanceof View) { continue; } try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getPrimaryKeys(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName()));) { while (results.next()) { createPrimaryKeyForTable(table, results); } } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve primary keys for table " + table, e); } } }
private void retrievePrimaryKeysFromMetadata(final NamedObjectList<MutableTable> allTables) throws SQLException { for (final MutableTable table: allTables) { if (table instanceof View) { continue; } try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getPrimaryKeys(table.getSchema().getCatalogName(), table.getSchema().getName(), table.getName()));) { while (results.next()) { createPrimaryKeyForTable(table, results); } } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve primary keys for table " + table, e); } } }
try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getProcedureColumns(procedure.getSchema().getCatalogName(), procedure.getSchema().getName(), procedure.getName(), null));)
try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getProcedureColumns(procedure.getSchema().getCatalogName(), procedure.getSchema().getName(), procedure.getName(), null));)
final String schemaName = schema.getName();
final String schemaName = schema.getName();
private void retrieveProceduresFromMetadata(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Procedure> procedureFilter) throws SQLException { for (final Schema schema: schemas) { LOGGER .log(Level.INFO, new StringFormat("Retrieving procedures for schema <%s>", schema)); final String catalogName = schema.getCatalogName(); final String schemaName = schema.getName(); try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getProcedures(catalogName, schemaName, "%"));) { results.setDescription("retrieveProceduresFromMetadata"); int numProcedures = 0; while (results.next()) { numProcedures = numProcedures + 1; createProcedure(results, schemas, procedureFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d procedures", numProcedures)); } } }
private void retrieveProceduresFromMetadata(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Procedure> procedureFilter) throws SQLException { for (final Schema schema: schemas) { LOGGER .log(Level.INFO, new StringFormat("Retrieving procedures for schema <%s>", schema)); final String catalogName = schema.getCatalogName(); final String schemaName = schema.getName(); try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getProcedures(catalogName, schemaName, "%"));) { results.setDescription("retrieveProceduresFromMetadata"); int numProcedures = 0; while (results.next()) { numProcedures = numProcedures + 1; createProcedure(results, schemas, procedureFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d procedures", numProcedures)); } } }
final String schemaName = schema.getName();
final String schemaName = schema.getName();
try (final MetadataResultSet results = new MetadataResultSet(getMetaData() .getFunctionColumns(function.getSchema().getCatalogName(), function.getSchema().getName(), function.getName(), null));)