Examples of SnapshotControl


Examples of liquibase.snapshot.SnapshotControl

        String url = "hibernate:ejb3:auction?hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy";
        Database database = CommandLineUtils.createDatabaseObject(this.getClass().getClassLoader(), url, null, null, null, null, null, false, false, null, null, null, null, null);

        assertNotNull(database);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, database, new SnapshotControl(database));

        assertThat(snapshot.get(Table.class), containsInAnyOrder(
                hasProperty("name", is("bid")),
                hasProperty("name", is("watcher")),
                hasProperty("name", is("user")),
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        String url = "hibernate:classic:com/example/pojo/Hibernate.cfg.xml";
        Database database = CommandLineUtils.createDatabaseObject(this.getClass().getClassLoader(), url, null, null, null, null, null, false, false, null, null, null, null, null);

        assertNotNull(database);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, database, new SnapshotControl(database));

        assertPojoHibernateMapped(snapshot);
    }
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        String url = "hibernate:classic:com/example/pojo/Hibernate.cfg.xml?hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy";
        Database database = CommandLineUtils.createDatabaseObject(this.getClass().getClassLoader(), url, null, null, null, null, null, false, false, null, null, null, null, null);

        assertNotNull(database);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, database, new SnapshotControl(database));

        assertThat(snapshot.get(Table.class), containsInAnyOrder(
                hasProperty("name", is("bid")),
                hasProperty("name", is("watcher")),
                hasProperty("name", is("auction_user")),
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

            return outString;
        }

        public void loadIndexData(Map<String, Object> context) {
            try {
                DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(database.getDefaultSchema(), database, new SnapshotControl(database));

                StringBuilder buffer = new StringBuilder();
                Database database = snapshot.getDatabase();

                buffer.append("<div class='panel panel-primary'>");
                buffer.append("<div class='panel-heading'><h2 style='margin-top:0px; margin-bottom:0px'>").append(StringUtils.escapeHtml(database.getConnection().getURL())).append("</h2></div>\n");
                buffer.append("<div class='panel-body'>");
                buffer.append("<strong>Database type:</strong> ").append(StringUtils.escapeHtml(database.getDatabaseProductName())).append("<br>\n");
                buffer.append("<strong>Database version:</strong> ").append(StringUtils.escapeHtml(database.getDatabaseProductVersion())).append("<br>\n");
                buffer.append("<strong>Database user:</strong> ").append(StringUtils.escapeHtml(database.getConnection().getConnectionUserName())).append("<br>\n");

                Set<Schema> schemas = snapshot.get(Schema.class);
                if (schemas.size() > 1) {
                    throw new UnexpectedLiquibaseException("Can only display one schema");
                }
                Schema schema = schemas.iterator().next();
                if (database.supportsSchemas()) {
                    buffer.append("<strong>Catalog & Schema:</strong> ").append(schema.getCatalogName()).append(" / ").append(schema.getName()).append("<br>\n");
                } else {
                    buffer.append("<strong>Catalog:</strong> ").append(schema.getCatalogName()).append("<br>\n");
                }

                buffer.append("</div>\n");
                buffer.append("</div>\n");

                SnapshotControl snapshotControl = snapshot.getSnapshotControl();
                List<Class> includedTypes = sort(snapshotControl.getTypesToInclude());

                StringBuilder catalogBuffer = new StringBuilder();

                StringBuilder detailsBuilder = new StringBuilder();
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

            addDivider(buffer);
            buffer.append("Database type: ").append(database.getDatabaseProductName()).append("\n");
            buffer.append("Database version: ").append(database.getDatabaseProductVersion()).append("\n");
            buffer.append("Database user: ").append(database.getConnection().getConnectionUserName()).append("\n");

            SnapshotControl snapshotControl = snapshot.getSnapshotControl();
            List<Class> includedTypes = sort(snapshotControl.getTypesToInclude());

            buffer.append("Included types:\n" ).append(StringUtils.indent(StringUtils.join(includedTypes, "\n", new StringUtils.StringUtilsFormatter<Class>() {
                @Override
                public String toString(Class obj) {
                    return obj.getName();
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        }

        Liquibase liquibase = createLiquibase("changelogs/mssql/issues/default.values.xml");
        liquibase.update((String) null);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, this.getDatabase(), new SnapshotControl(getDatabase()));

        for (Table table : snapshot.get(Table.class)) {
            for (Column column : table.getColumns()) {
                if (column.getName().toLowerCase().endsWith("_default")) {
                    Object defaultValue = column.getDefaultValue();
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        }

        Liquibase liquibase = createLiquibase("changelogs/mssql/issues/data.types.xml");
        liquibase.update((String) null);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, this.getDatabase(), new SnapshotControl(getDatabase()));

        for (Table table : snapshot.get(Table.class)) {
            if (getDatabase().isLiquibaseObject(table)) {
                continue;
            }
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        }

        Liquibase liquibase = createLiquibase("changelogs/mssql/issues/data.type.params.xml");
        liquibase.update((String) null);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, this.getDatabase(), new SnapshotControl(getDatabase()));

        for (Table table : snapshot.get(Table.class)) {
            if (getDatabase().isLiquibaseObject(table)) {
                continue;
            }
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        String url = "hibernate:spring:spring.ctx.xml?bean=sessionFactory";
        Database database = CommandLineUtils.createDatabaseObject(this.getClass().getClassLoader(), url, null, null, null, null, null, false, false, null, null, null, null, null);

        assertNotNull(database);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, database, new SnapshotControl(database));

        HibernateClassicDatabaseTest.assertPojoHibernateMapped(snapshot);
    }
View Full Code Here

Examples of liquibase.snapshot.SnapshotControl

        String url = "hibernate:spring:com.example.ejb3.auction?dialect=" + HSQLDialect.class.getName();
        Database database = CommandLineUtils.createDatabaseObject(this.getClass().getClassLoader(), url, null, null, null, null, null, false, false, null, null, null, null, null);

        assertNotNull(database);

        DatabaseSnapshot snapshot = SnapshotGeneratorFactory.getInstance().createSnapshot(CatalogAndSchema.DEFAULT, database, new SnapshotControl(database));

        HibernateEjb3DatabaseTest.assertEjb3HibernateMapped(snapshot);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.