private static void bindSchemaSelection(List<?> selection, OverrideRepository repository) { Iterator<?> iterator = selection.iterator(); while ( iterator.hasNext() ) { Element element = (Element) iterator.next(); SchemaSelection schemaSelection = new SchemaSelection(); schemaSelection.setMatchCatalog( element.attributeValue("match-catalog") ); schemaSelection.setMatchSchema( element.attributeValue("match-schema") ); schemaSelection.setMatchTable( element.attributeValue("match-table") ); repository.addSchemaSelection(schemaSelection); } }
@Override public List<SchemaSelection> getSchemaSelections() { return selectedTableNames .stream() .map((table) -> new SchemaSelection(catalog, schema, table)) .collect(Collectors.toList()); } };
progress.startSubTask("Finding tables in " + schemaSelection); String matchCatalog = StringHelper.replace(schemaSelection.getMatchCatalog(),".*", "%"); String matchSchema = StringHelper.replace(schemaSelection.getMatchSchema(),".*", "%"); String matchTable = StringHelper.replace(schemaSelection.getMatchTable(),".*", "%"); tableIterator = metaDataDialect.getTables(matchCatalog, matchSchema, matchTable); String[] lastQualifier = null;
private boolean isTable(Object key) throws HibernateException { // BIG HACK - should probably utilize the table cache before going to the jdbcreader :( if(key instanceof String) { String[] strings = StringHelper.split(".", (String) key); if(strings.length==1) { tableSelector.clearSchemaSelections(); tableSelector.addSchemaSelection( new SchemaSelection(null,null, strings[0]) ); List<?> list = reader.readDatabaseSchema( dbc, null, null ); return !list.isEmpty(); } else if(strings.length==3) { tableSelector.clearSchemaSelections(); tableSelector.addSchemaSelection( new SchemaSelection(strings[0],strings[1], strings[2]) ); List<?> list = reader.readDatabaseSchema( dbc, null, null ); return !list.isEmpty(); } else if (strings.length==2) { tableSelector.clearSchemaSelections(); tableSelector.addSchemaSelection( new SchemaSelection(null,strings[0], strings[1]) ); List<?> list = reader.readDatabaseSchema( dbc, null, null ); return !list.isEmpty(); } } return false; }
private void setSchemaSelection(Table table) { tableSelector.clearSchemaSelections(); tableSelector.addSchemaSelection( new SchemaSelection( table .getCatalog(), table.getSchema(), table.getName() ) ); }
List<Table> foundTables = new ArrayList<Table>(); if(schemaSelectors==null) { foundTables.addAll(TableProcessor.processTables(getMetaDataDialect(), revengStrategy, defaultSchema, defaultCatalog, dbs, new SchemaSelection(catalog, schema), hasIndices, progress)); } else { for (Iterator<SchemaSelection> iter = schemaSelectors.iterator(); iter.hasNext();) {