@Test public void viewDefinitions(final TestContext testContext, final Connection connection) throws Exception { final Config config = loadHsqldbConfig(); final SchemaRetrievalOptions schemaRetrievalOptions = SchemaRetrievalOptionsBuilder .newSchemaRetrievalOptions(config); final SchemaCrawlerOptionsBuilder schemaCrawlerOptionsBuilder = SchemaCrawlerOptionsBuilder .builder(); schemaCrawlerOptionsBuilder.tableTypes("VIEW"); schemaCrawlerOptionsBuilder .withSchemaInfoLevel(SchemaInfoLevelBuilder.maximum()); final Catalog catalog = getCatalog(connection, schemaRetrievalOptions, schemaCrawlerOptionsBuilder.toOptions()); final Schema schema = new SchemaReference("PUBLIC", "BOOKS"); final View view = (View) catalog.lookupTable(schema, "AUTHORSLIST").get(); assertThat("View not found", view, notNullValue()); assertThat("View definition not found", view.getDefinition(), notNullValue()); assertThat("View definition not found", isBlank(view.getDefinition()), is(false)); }
if (!"default".equals(tableTypes)) schemaCrawlerOptionsBuilder.tableTypes(tableTypes);
if (!isBlank(tabletypes)) optionsBuilder.tableTypes(tabletypes); optionsBuilder.tableTypes((String) null);
if (!isBlank(tabletypes)) optionsBuilder.tableTypes(tabletypes); optionsBuilder.tableTypes((String) null);
if (!isBlank(tabletypes)) optionsBuilder.tableTypes(tabletypes); optionsBuilder.tableTypes((String) null);
if (!isBlank(tabletypes)) optionsBuilder.tableTypes(tabletypes); optionsBuilder.tableTypes((String) null);