All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jarbframework.migrations.liquibase.LiquibaseMigratingDatabaseBuilder Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
/*
 * (C) 2013 42 bv (www.42.nl). All rights reserved.
 */
package org.jarbframework.migrations.liquibase;

import org.jarbframework.migrations.MigratingDatabaseBuilder;

/**
 * Embedded database builder that also migrates the schema.
 *
 * @author Jeroen van Schagen
 * @since Feb 12, 2014
 */
public class LiquibaseMigratingDatabaseBuilder extends MigratingDatabaseBuilder {
    
    /**
     * The liquibase migrator to be used.
     */
    private final LiquibaseMigrator migrator;
    
    /**
     * Create database from the default liquibase migrator.
     */
    public LiquibaseMigratingDatabaseBuilder() {
        this(LiquibaseMigrator.local());
    }
    
    /**
     * Create database from a specific liquibase migrator.
     * @param migrator the liquibase migrator
     */
    public LiquibaseMigratingDatabaseBuilder(LiquibaseMigrator migrator) {
        super(migrator);
        this.migrator = migrator;
    }

    /**
     * Change the change log path, this is by default 'src/main/db/changelog.groovy'
     * 
     * @param changeLogPath the change log path
     * @return this builder instance, for chaining
     */
    public LiquibaseMigratingDatabaseBuilder setChangeLogPath(String changeLogPath) {
        migrator.setChangeLogPath(changeLogPath);
        return this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy