Package liquibase.resource

Examples of liquibase.resource.ClassLoaderResourceAccessor


            } else {
                throw new RuntimeException("No database provider configured");
            }
            provider.start();
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            if (System.getProperty("liquibase") == null || !System.getProperty("liquibase").equals("false")) {
                // If database is locked, retry 10 times before we give up and force the lock to be released
                for(int i=0;i<10 && liquibase.listLocks().length>0;i++) {
View Full Code Here


        if (getExecutionConfiguration().getBooleanParameter("deletePrevious", Boolean.FALSE)) {
            String database = InjectHelper.instanceWithName(String.class, "org.socialmusicdiscovery.server.database");
            DatabaseProvider provider = InjectHelper.instanceWithName(DatabaseProvider.class, database);
            try {
                Connection connection = provider.getConnection();
                Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database-drop.xml", new
                        ClassLoaderResourceAccessor(),
                        new JdbcConnection(connection));
                liquibase.update("");
                liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                        ClassLoaderResourceAccessor(),
                        new JdbcConnection(connection));
                liquibase.update("");
            } catch (LiquibaseException e) {
                e.printStackTrace();
View Full Code Here

        return false;
    }

    void execute(Connection connection) throws PluginException {
        try {
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/sampledata/smd-database.sampledata.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
        } catch (LiquibaseException e) {
            e.printStackTrace();
View Full Code Here

        String database = InjectHelper.instanceWithName(String.class, "org.socialmusicdiscovery.server.database");
        DatabaseProvider provider = InjectHelper.instanceWithName(DatabaseProvider.class, database);
        try {
            progressHandler.progress(getId(),"Deleting database contents",1L,2L);
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database-drop.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
            progressHandler.progress(getId(), "Creating fresh database", 2L, 2L);
            liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
            progressHandler.finished(getId());
        } catch (LiquibaseException e) {
View Full Code Here

            } else {
                throw new RuntimeException("No database provider configured");
            }
            provider.start();
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            if (System.getProperty("liquibase") == null || !System.getProperty("liquibase").equals("false")) {
                liquibase.update("");
            }
            liquibase = new Liquibase("org/socialmusicdiscovery/server/database/sampledata/large/large.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");

            // Ensure that we don't delete the database contents
View Full Code Here

        String dbDriver = DatabaseFactory.getInstance().findDefaultDriver(testDs.connectionUrl);
        Database database = CommandLineUtils.createDatabaseObject(DbSetupUtility.class.getClassLoader(),
            testDs.connectionUrl, testDs.userName, testDs.password, dbDriver, null, null, null);
        //Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(
        //    new JdbcConnection(AbstractEJB3Test.getConnection()));
        Liquibase liquibase = new Liquibase(null, new ClassLoaderResourceAccessor(), database);
        liquibase.dropAll();
        dropRhqCalltimeDataKeyTable(database);
    }
View Full Code Here

           * Derby doesn't support the CREATE OR REPLACE syntax for Views and Liquibase will throw
           * an error if the attribute is specified for Derby or H2.
           * As we will use those DBs usually in memory, we'll just remote the attribute in all change logs
           * using a custom ResourceAccessor that will filter the character stream.
           */
          ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor();
          if (dbType == DbType.DERBY || dbType == DbType.H2) {
            resourceAccessor = new ResourceAccessorFilter(resourceAccessor);
          }
         
          Liquibase liquibase = new Liquibase(changeLogResourceName, resourceAccessor, db);
View Full Code Here

           * Derby doesn't support the CREATE OR REPLACE syntax for Views and Liquibase will throw
           * an error if the attribute is specified for Derby or H2.
           * As we will use those DBs usually in memory, we'll just remote the attribute in all change logs
           * using a custom ResourceAccessor that will filter the character stream.
           */
          ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor();
          if (dbType == DbType.DERBY || dbType == DbType.H2) {
            resourceAccessor = new ResourceAccessorFilter(resourceAccessor);
          }
         
          Liquibase liquibase = new Liquibase(changeLogResourceName, resourceAccessor, db);
View Full Code Here

            Connection connection = null;
            try {

                connection = dataSource.get().getConnection();
                DatabaseConnection dc = new JdbcConnection( connection );
                Liquibase liquibase = new Liquibase( config.get().changeLog().get(), new ClassLoaderResourceAccessor(), dc );
                liquibase.update( config.get().contexts().get() );

            } catch ( SQLException e ) {

                Throwable ex = e;
View Full Code Here

    private static final String DEFAULT_MIGRATIONS_FILE = "migrations.xml";
    private final ManagedDataSource dataSource;

    public CloseableLiquibase(ManagedDataSource dataSource) throws LiquibaseException, SQLException {
        super(DEFAULT_MIGRATIONS_FILE,
              new ClassLoaderResourceAccessor(),
              new JdbcConnection(dataSource.getConnection()));
        this.dataSource = dataSource;
    }
View Full Code Here

TOP

Related Classes of liquibase.resource.ClassLoaderResourceAccessor

Copyright © 2018 www.massapicom. 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.