Class AbstractDatabaseVersionService

java.lang.Object
com.avoka.core.service.initialization.AbstractDatabaseVersionService
Direct Known Subclasses:
DatabaseVersionService

public abstract class AbstractDatabaseVersionService extends Object
Provides an abstract Database version management service.
  • Field Details

    • DATABASE_PRODUCT_MYSQL

      public static final String DATABASE_PRODUCT_MYSQL
      The database product for MySQL
      See Also:
    • DATABASE_PRODUCT_ORACLE

      public static final String DATABASE_PRODUCT_ORACLE
      The database product for Oracle
      See Also:
    • DATABASE_PRODUCT_SQLSERVER

      public static final String DATABASE_PRODUCT_SQLSERVER
      The database product for MS SQL Server without Unicode support
      See Also:
    • DATABASE_PRODUCT_SQLSERVER_UNICODE

      public static final String DATABASE_PRODUCT_SQLSERVER_UNICODE
      The database product for MS SQL Server with Unicode support
      See Also:
    • LOG_DIRECTORY_RELATIVE

      protected static final String LOG_DIRECTORY_RELATIVE
    • DB_VERSION_FILE_NAME

      protected static final String DB_VERSION_FILE_NAME
      See Also:
    • DATETIME_FORMAT

      protected static final String DATETIME_FORMAT
      See Also:
    • ATTRIBUTE_IGNORE_ERRORS

      protected static final String ATTRIBUTE_IGNORE_ERRORS
      See Also:
    • logger

      protected org.slf4j.Logger logger
  • Constructor Details

    • AbstractDatabaseVersionService

      public AbstractDatabaseVersionService()
  • Method Details

    • performUpdate

      public void performUpdate(File appserverDirectory, boolean debugFlag)
      Perform database schema and data migration update.
      Parameters:
      appserverDirectory - the application server directory, used to determine log file path
      debugFlag - specify whether to perform debug logging
    • performUpdate

      public void performUpdate(File appserverDirectory, Set<Integer> skipVersions, boolean debugFlag)
      Perform database schema and data migration update, with option to skip version execution. Note: usage of that method is preferred for unit testing.
      Parameters:
      appserverDirectory - the application server directory, used to determine log file path
      skipVersions - skip execution of those versions
      debugFlag - specify whether to perform debug logging
      Since:
      19.11.0
    • getJndiName

      protected abstract String getJndiName()
    • getHistoryJndiName

      protected abstract String getHistoryJndiName()
    • getVersionUpdateEntityName

      protected abstract String getVersionUpdateEntityName()
    • getCurrentDatabaseVersions

      protected abstract List<Integer> getCurrentDatabaseVersions()
    • getDatabaseProduct

      protected abstract String getDatabaseProduct()
    • getCurrentDatabaseReleaseVersions

      protected abstract List<String> getCurrentDatabaseReleaseVersions()
    • getAdminConsoleWarVersion

      protected abstract String getAdminConsoleWarVersion(org.apache.cayenne.access.DataContext dataContext)
    • createVersionUpdate

      protected abstract void createVersionUpdate(org.apache.cayenne.access.DataContext dataContext, Element updateElement, int rowsUpdated, String updatePerformed, Date finishTime, long updateDuration) throws SQLException
      Throws:
      SQLException
    • fail

      protected void fail(String message)
    • getLogFileLocation

      protected String getLogFileLocation(File appserverDirectory)