@Test @DisplayName("Retrieve foreign keys from data dictionary") public void fkFromDataDictionary(final Connection connection) throws Exception { final InformationSchemaViews informationSchemaViews = InformationSchemaViewsBuilder.builder() .withSql( InformationSchemaKey.FOREIGN_KEYS, "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_CROSSREFERENCE") .toOptions(); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = SchemaRetrievalOptionsBuilder.builder(); schemaRetrievalOptionsBuilder .with(foreignKeysRetrievalStrategy, data_dictionary_all) .withInformationSchemaViews(informationSchemaViews); final SchemaRetrievalOptions schemaRetrievalOptions = schemaRetrievalOptionsBuilder.toOptions(); final RetrieverConnection retrieverConnection = new RetrieverConnection(connection, schemaRetrievalOptions); final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions(); final ForeignKeyRetriever foreignKeyRetriever = new ForeignKeyRetriever(retrieverConnection, catalog, options); foreignKeyRetriever.retrieveForeignKeys(catalog.getAllTables()); verifyRetrieveForeignKeys(catalog); }
void retrieveForeignKeys(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(foreignKeysRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving foreign keys, using fast data dictionary retrieval"); retrieveForeignKeysFromDataDictionary(); break; case metadata: LOGGER.log(Level.INFO, "Retrieving foreign keys"); retrieveForeignKeysFromMetadata(allTables); break; default: break; } }
ForeignKeyRetriever extends AbstractRetriever { void retrieveForeignKeys(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(foreignKeysRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving foreign keys, using fast data dictionary retrieval"); retrieveForeignKeysFromDataDictionary(); break; case metadata: LOGGER.log(Level.INFO, "Retrieving foreign keys"); retrieveForeignKeysFromMetadata(allTables); break; default: break; } } }
ForeignKeyRetriever extends AbstractRetriever { void retrieveForeignKeys(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(foreignKeysRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving foreign keys, using fast data dictionary retrieval"); retrieveForeignKeysFromDataDictionary(); break; case metadata: LOGGER.log(Level.INFO, "Retrieving foreign keys"); retrieveForeignKeysFromMetadata(allTables); break; default: break; } } ForeignKeyRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options); }
ForeignKeyRetriever extends AbstractRetriever { void retrieveForeignKeys(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(foreignKeysRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving foreign keys, using fast data dictionary retrieval"); retrieveForeignKeysFromDataDictionary(); break; case metadata: LOGGER.log(Level.INFO, "Retrieving foreign keys"); retrieveForeignKeysFromMetadata(allTables); break; default: break; } } ForeignKeyRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options);  }
ForeignKeyRetriever extends AbstractRetriever { void retrieveForeignKeys(final NamedObjectList<MutableTable> allTables) throws SQLException { requireNonNull(allTables, "No tables provided"); switch (getRetrieverConnection().get(foreignKeysRetrievalStrategy)) { case data_dictionary_all: LOGGER.log(Level.INFO, "Retrieving foreign keys, using fast data dictionary retrieval"); retrieveForeignKeysFromDataDictionary(); break; case metadata: LOGGER.log(Level.INFO, "Retrieving foreign keys"); retrieveForeignKeysFromMetadata(allTables); break; default: break; } } ForeignKeyRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options);   }