Code example for Set

Methods: sizetoArray

0
 
    private void generateChangeLog(final Database database, final CatalogAndSchema catalogAndSchema,
                                   final DiffToChangeLog changeLogWriter, PrintStream outputStream,
                                   final Set<Class<? extends DatabaseObject>> compareTypes) throws DatabaseException, IOException, ParserConfigurationException {
        @SuppressWarnings("unchecked") 
        final SnapshotControl snapshotControl = new SnapshotControl(database, compareTypes.toArray(new Class[compareTypes.size()]));
        final CompareControl compareControl = new CompareControl(new CompareControl.SchemaComparison[]{new CompareControl.SchemaComparison(catalogAndSchema, catalogAndSchema)}, compareTypes);
        final CatalogAndSchema[] compareControlSchemas = compareControl.getSchemas(CompareControl.DatabaseRole.REFERENCE);
 
        try { 
            final DatabaseSnapshot referenceSnapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(compareControlSchemas, database, snapshotControl);
            final DatabaseSnapshot comparisonSnapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(compareControlSchemas, null, snapshotControl);
            final DiffResult diffResult = DiffGeneratorFactory.getInstance().compare(referenceSnapshot, comparisonSnapshot, compareControl);
 
            changeLogWriter.setDiffResult(diffResult);
            changeLogWriter.print(outputStream);
        } catch (InvalidExampleException e) {
            throw new UnexpectedLiquibaseException(e);
        } 
    }