Class AbstractPatch

java.lang.Object
de.hybris.platform.patches.AbstractPatch
All Implemented Interfaces:
Patch
Direct Known Subclasses:
AbstractDemoPatch

public abstract class AbstractPatch extends Object implements Patch
Base class for all new patches.
  • Field Details

    • patchId

      protected String patchId
    • patchName

      protected String patchName
    • release

      protected Release release
    • structureState

      protected StructureState structureState
    • importPatchAction

      protected PatchAction importPatchAction
    • sqlCommandPatchAction

      protected PatchAction sqlCommandPatchAction
  • Constructor Details

  • Method Details

    • importGlobalData

      protected void importGlobalData(String fileName, Collection<ImportLanguage> languages, boolean runAgain)
      Imports global impex data for given languages.
      Parameters:
      fileName - of impex to be imported
      languages - for which data should be imported
      runAgain - if patch should be executed again
    • importGlobalData

      protected void importGlobalData(String fileName, Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions)
      Imports global impex data for given languages.
      Parameters:
      fileName - of impex to be imported
      languages - for which data should be imported
      runAgain - if patch should be executed again
      importOptions - optional set of options that define how impex should be executed
    • importData

      protected void importData(String fileName, ImportOrganisationUnit organisationUnit, Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions, ImpexHeaderOption[][] headerOptions)
      Imports impex data for given organisation and languages.
      Parameters:
      fileName - of impex to be imported
      organisationUnit - for which data should be imported
      languages - for which data should be imported
      runAgain - if patch should be executed again
      importOptions - optional set of options that define how impex should be executed
      headerOptions - additional header options
    • executeUpdateOnDB

      protected void executeUpdateOnDB(String actionName, String query)
      Executes direct SQL update for specified query.
      Parameters:
      actionName - a human-readable name of the action.
      query - to be executed on DB (directly, not through hybris ORM)
    • executeUpdateOnDB

      protected void executeUpdateOnDB(String actionName, String query, ImportOrganisationUnit organisationUnit)
      Executes direct SQL update for specified query.
      Parameters:
      actionName - a human-readable name of the action.
      query - to be executed on DB (directly, not through hybris ORM)
      organisationUnit - organisation unit
    • getStructureState

      public StructureState getStructureState()
      Description copied from interface: Patch
      Gets StructureState from this patch
      Specified by:
      getStructureState in interface Patch
      Returns:
      StructureState from this patch
    • getPatchId

      public String getPatchId()
      Description copied from interface: Patch
      Returns unique patch id (e.g PD_V_1.0.1).
      Specified by:
      getPatchId in interface Patch
      Returns:
      patch id
    • getPatchName

      public String getPatchName()
      Description copied from interface: Patch
      Returns Patch name.
      Specified by:
      getPatchName in interface Patch
      Returns:
      patch name (visible in admin console)
    • getPatchDescription

      public String getPatchDescription()
      Description copied from interface: Patch
      Returns Patch description.
      Specified by:
      getPatchDescription in interface Patch
      Returns:
      description what this patch is about
    • getRelease

      public Release getRelease()
      Description copied from interface: Patch
      Gets release that patch is part of.
      Specified by:
      getRelease in interface Patch
      Returns:
      release that patch is part of
    • setImportPatchAction

      public void setImportPatchAction(PatchAction importPatchAction)
    • setSqlCommandPatchAction

      public void setSqlCommandPatchAction(PatchAction sqlCommandPatchAction)