Class AbstractSqlScriptBasedDbSchemaManager

java.lang.Object
org.flowable.common.engine.impl.db.AbstractSqlScriptBasedDbSchemaManager
All Implemented Interfaces:
SchemaManager
Direct Known Subclasses:
ProcessDbSchemaManager, ServiceSqlScriptBasedDbSchemaManager

public abstract class AbstractSqlScriptBasedDbSchemaManager extends Object implements SchemaManager
Author:
Joram Barrez
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • JDBC_METADATA_TABLE_TYPES

      public static String[] JDBC_METADATA_TABLE_TYPES
    • PROPERTY_TABLE

      protected static final String PROPERTY_TABLE
      See Also:
    • SCHEMA_VERSION_PROPERTY

      protected static final String SCHEMA_VERSION_PROPERTY
      See Also:
  • Constructor Details

    • AbstractSqlScriptBasedDbSchemaManager

      public AbstractSqlScriptBasedDbSchemaManager()
  • Method Details

    • dbSchemaUpgradeUntil6120

      protected void dbSchemaUpgradeUntil6120(String component, int currentDatabaseVersionsIndex, String dbVersion)
    • dbSchemaUpgrade

      protected void dbSchemaUpgrade(String component, int currentDatabaseVersionsIndex, String engineDbVersion)
    • isTablePresent

      public boolean isTablePresent(String tableName)
    • prependDatabaseTablePrefix

      protected String prependDatabaseTablePrefix(String tableName)
    • getDbSqlSession

      public DbSqlSession getDbSqlSession()
    • getProperty

      public String getProperty(String propertyName)
    • getPropertyTable

      protected String getPropertyTable()
    • getResourceForDbOperation

      public String getResourceForDbOperation(String directory, String operation, String component, String databaseType)
    • getResourcesRootDirectory

      protected abstract String getResourcesRootDirectory()
    • executeMandatorySchemaResource

      public void executeMandatorySchemaResource(String operation, String component)
    • executeSchemaResource

      public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional)
    • executeSchemaResource

      protected void executeSchemaResource(String operation, String component, String resourceName, InputStream inputStream)
    • updateDdlForMySqlVersionLowerThan56

      protected String updateDdlForMySqlVersionLowerThan56(String ddlStatements)
      MySQL is funny when it comes to timestamps and dates. More specifically, for a DDL statement like 'MYCOLUMN timestamp(3)': - MySQL 5.6.4+ has support for timestamps/dates with millisecond (or smaller) precision. The DDL above works and the data in the table will have millisecond precision - MySQL before 5.5.3 allows the DDL statement, but ignores it. The DDL above works but the data won't have millisecond precision - MySQL 5.5.3 before [version] after 5.6.4 gives and exception when using the DDL above. Also, the 5.5 and 5.6 branches of MySQL are both actively developed and patched. Hence, when doing auto-upgrade/creation of the Flowable tables, the default MySQL DDL file is used and all timestamps/datetimes are converted to not use the millisecond precision by string replacement done in the method below. If using the DDL files directly (which is a sane choice in production env.), there is a distinction between MySQL version before 5.6.
    • addSqlStatementPiece

      protected String addSqlStatementPiece(String sqlStatement, String line)
    • readNextTrimmedLine

      protected String readNextTrimmedLine(BufferedReader reader) throws IOException
      Throws:
      IOException