Class CopyToBusinessUnitChange

java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.liquibase.CopyToBusinessUnitChange
All Implemented Interfaces:
liquibase.change.custom.CustomChange, liquibase.change.custom.CustomTaskChange

public class CopyToBusinessUnitChange extends Object implements liquibase.change.custom.CustomTaskChange
Used to copy entities from the one business unit to another Parameters: * sourceBusinessUnitId (default = business unit with the lowest pk) * targetBusinessUnitId business unit id to copy to * tableName Name of the database table * businessUnitFkColumn fk of business unit relation (default = fk_business_unit) * pkColumn pk of your table (default = pk)
  • Constructor Details

    • CopyToBusinessUnitChange

      public CopyToBusinessUnitChange()
  • Method Details

    • execute

      public void execute(liquibase.database.Database database) throws liquibase.exception.CustomChangeException
      Specified by:
      execute in interface liquibase.change.custom.CustomTaskChange
      Throws:
      liquibase.exception.CustomChangeException
    • getConfirmationMessage

      public String getConfirmationMessage()
      Specified by:
      getConfirmationMessage in interface liquibase.change.custom.CustomChange
    • setUp

      public void setUp() throws liquibase.exception.SetupException
      Specified by:
      setUp in interface liquibase.change.custom.CustomChange
      Throws:
      liquibase.exception.SetupException
    • setFileOpener

      public void setFileOpener(liquibase.resource.ResourceAccessor resourceAccessor)
      Specified by:
      setFileOpener in interface liquibase.change.custom.CustomChange
    • validate

      public liquibase.exception.ValidationErrors validate(liquibase.database.Database database)
      Specified by:
      validate in interface liquibase.change.custom.CustomChange
    • getSourceBusinessUnitId

      public Optional<String> getSourceBusinessUnitId()
    • setSourceBusinessUnitId

      public void setSourceBusinessUnitId(@Nullable @Nullable String sourceBusinessUnitId)
    • getTargetBusinessUnitId

      public String getTargetBusinessUnitId()
    • setTargetBusinessUnitId

      public void setTargetBusinessUnitId(String targetBusinessUnitId)
    • getTableName

      public String getTableName()
    • setTableName

      public void setTableName(String tableName)
    • getBusinessUnitFkColumn

      public String getBusinessUnitFkColumn()
    • setBusinessUnitFkColumn

      public void setBusinessUnitFkColumn(@Nullable @Nullable String businessUnitFkColumn)
    • getPkColumn

      public String getPkColumn()
    • setPkColumn

      public void setPkColumn(@Nullable @Nullable String pkColumn)