Package liquibase.resource

Examples of liquibase.resource.ResourceAccessor


           * 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

    try {
      Connection connection = null;
      try {
        Thread currentThread = Thread.currentThread();
        ClassLoader classLoader = currentThread.getContextClassLoader();
        ResourceAccessor accessor = new ClassLoaderResourceAccessor(classLoader);

        DataSource dataSource = getDataSource(sessionFactory);
        connection = dataSource.getConnection();
        JdbcConnection jdbcConnection = new JdbcConnection(connection);
View Full Code Here

  @Resource
  private DataSource ds;

  @PostConstruct
  protected void bootstrap() {
    ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor(getClass().getClassLoader());
    try (Connection connection = ds.getConnection()) {
      JdbcConnection jdbcConnection = new JdbcConnection(connection);
      Database db = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(jdbcConnection);

      Liquibase liquiBase = new Liquibase(CHANGELOG_FILE, 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

      getLog().info(indent + "label(s): " + labels);
  }

  @Override
  protected ResourceAccessor getFileOpener(ClassLoader cl) {
    ResourceAccessor mFO = new MavenResourceAccessor(cl);
    ResourceAccessor fsFO = new FileSystemResourceAccessor(project.getBasedir().getAbsolutePath());
    return new CompositeResourceAccessor(mFO, fsFO);
  }
View Full Code Here

            throw new MojoExecutionException("Failed to create project classloader", e);
        }
    }

    protected ResourceAccessor getFileOpener(ClassLoader cl) {
        ResourceAccessor mFO = new MavenResourceAccessor(cl);
        ResourceAccessor fsFO = new FileSystemResourceAccessor(project.getBasedir().getAbsolutePath());
        return new CompositeResourceAccessor(mFO, fsFO);
    }
View Full Code Here

        classLoader.setParentFirst(false);
        classLoader.setThreadContextLoader();
        validateParameters();
        Database database = null;
        try {
            ResourceAccessor resourceAccessor = createResourceAccessor(classLoader);
            database = createDatabaseFromType(databaseType);
            String changeLogFilePath = getChangeLogFilePath();
            liquibase = new Liquibase(changeLogFilePath, resourceAccessor, database);
            if(changeLogParameters != null) {
                changeLogParameters.applyParameters(liquibase);
View Full Code Here

            connection = dataSource.getConnection();

            Thread currentThread = Thread.currentThread();
            ClassLoader contextClassLoader = currentThread.getContextClassLoader();
            ResourceAccessor threadClFO = new ClassLoaderResourceAccessor(contextClassLoader);

            ResourceAccessor clFO = new ClassLoaderResourceAccessor();
            ResourceAccessor fsFO = new FileSystemResourceAccessor();


            database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
            database.setDefaultSchemaName(getDefaultSchema());
            Liquibase liquibase = new Liquibase(getChangeLogFile(), new CompositeResourceAccessor(clFO, fsFO, threadClFO), database);
View Full Code Here

    }

    public CheckSum calculateCheckSum(final String filename, final String id, final String author) throws LiquibaseException {
        log.info(String.format("Calculating checksum for changeset %s::%s::%s", filename, id, author));
        final ChangeLogParameters changeLogParameters = this.getChangeLogParameters();
        final ResourceAccessor resourceAccessor = this.getResourceAccessor();
        final DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(this.changeLogFile, resourceAccessor).parse(this.changeLogFile, changeLogParameters, resourceAccessor);

        // TODO: validate?

        final ChangeSet changeSet = changeLog.getChangeSet(filename, author, id);
View Full Code Here

TOP

Related Classes of liquibase.resource.ResourceAccessor

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.