Class MultiTenantSpringLiquibase

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware

    public class MultiTenantSpringLiquibase
    extends Object
    implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
    A wrapper of Liquibase suitable in multi-tenant environments where multiple data sources represent tenants. It utilizes SpringLiquibase per each data source. All the parameters are the same as for SpringLiquibase except of the data source definition - in this case it is a list of data sources available under specified JNDI subtree. You have to define the subtree with jndiBase property.

    The wrapper scans the subtree for all data sources and creates SpringLiquibase instances.

    Example:

     <bean id="liquibase" class="liquibase.integration.spring.MultiTenantSpringLiquibase">
            <property name="jndiBase" value="java:comp/env/jdbc/db" />
            <property name="changeLog" value="classpath:db/migration/db-changelog.xml" />        
     </bean>
     
    See Also:
    SpringLiquibase
    • Constructor Detail

      • MultiTenantSpringLiquibase

        public MultiTenantSpringLiquibase()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getJndiBase

        public String getJndiBase()
      • setJndiBase

        public void setJndiBase​(String jndiBase)
      • getChangeLog

        public String getChangeLog()
      • setChangeLog

        public void setChangeLog​(String changeLog)
      • getContexts

        public String getContexts()
      • setContexts

        public void setContexts​(String contexts)
      • getLabelFilter

        public String getLabelFilter()
      • setLabelFilter

        public void setLabelFilter​(String labelFilter)
      • setParameters

        public void setParameters​(Map<String,​String> parameters)
      • getDefaultSchema

        public String getDefaultSchema()
      • setDefaultSchema

        public void setDefaultSchema​(String defaultSchema)
      • getLiquibaseSchema

        public String getLiquibaseSchema()
      • setLiquibaseSchema

        public void setLiquibaseSchema​(String liquibaseSchema)
      • getLiquibaseTablespace

        public String getLiquibaseTablespace()
      • setLiquibaseTablespace

        public void setLiquibaseTablespace​(String liquibaseTablespace)
      • getDatabaseChangeLogTable

        public String getDatabaseChangeLogTable()
      • setDatabaseChangeLogTable

        public void setDatabaseChangeLogTable​(String databaseChangeLogTable)
      • getDatabaseChangeLogLockTable

        public String getDatabaseChangeLogLockTable()
      • setDatabaseChangeLogLockTable

        public void setDatabaseChangeLogLockTable​(String databaseChangeLogLockTable)
      • isDropFirst

        public boolean isDropFirst()
      • setDropFirst

        public void setDropFirst​(boolean dropFirst)
      • isClearCheckSums

        public boolean isClearCheckSums()
      • setClearCheckSums

        public void setClearCheckSums​(boolean clearCheckSums)
      • isShouldRun

        public boolean isShouldRun()
      • setShouldRun

        public void setShouldRun​(boolean shouldRun)
      • getRollbackFile

        public File getRollbackFile()
      • setRollbackFile

        public void setRollbackFile​(File rollbackFile)
      • setResourceLoader

        public void setResourceLoader​(org.springframework.core.io.ResourceLoader resourceLoader)
        Specified by:
        setResourceLoader in interface org.springframework.context.ResourceLoaderAware
      • setSchemas

        public void setSchemas​(List<String> schemas)
      • getDataSource

        public DataSource getDataSource()
      • setDataSource

        public void setDataSource​(DataSource dataSource)