Class AbstractSqlScriptBasedDbSchemaManager
- java.lang.Object
-
- org.flowable.common.engine.impl.db.AbstractSqlScriptBasedDbSchemaManager
-
- All Implemented Interfaces:
SchemaManager
- Direct Known Subclasses:
ServiceSqlScriptBasedDbSchemaManager
public abstract class AbstractSqlScriptBasedDbSchemaManager extends Object implements SchemaManager
- Author:
- Joram Barrez
-
-
Field Summary
Fields Modifier and Type Field Description static String[]JDBC_METADATA_TABLE_TYPESprotected org.slf4j.Loggerloggerprotected static StringPROPERTY_TABLEprotected static StringSCHEMA_VERSION_PROPERTY
-
Constructor Summary
Constructors Constructor Description AbstractSqlScriptBasedDbSchemaManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringaddSqlStatementPiece(String sqlStatement, String line)protected voiddbSchemaUpgrade(String component, int currentDatabaseVersionsIndex, String engineDbVersion)protected voiddbSchemaUpgradeUntil6120(String component, int currentDatabaseVersionsIndex, String dbVersion)voidexecuteMandatorySchemaResource(String operation, String component)voidexecuteSchemaResource(String operation, String component, String resourceName, boolean isOptional)protected voidexecuteSchemaResource(String operation, String component, String resourceName, InputStream inputStream)DbSqlSessiongetDbSqlSession()StringgetProperty(String propertyName)protected StringgetPropertyTable()StringgetResourceForDbOperation(String directory, String operation, String component, String databaseType)protected abstract StringgetResourcesRootDirectory()booleanisTablePresent(String tableName)protected StringprependDatabaseTablePrefix(String tableName)protected StringreadNextTrimmedLine(BufferedReader reader)protected StringupdateDdlForMySqlVersionLowerThan56(String ddlStatements)MySQL is funny when it comes to timestamps and dates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.flowable.common.engine.impl.db.SchemaManager
schemaCheckVersion, schemaCreate, schemaDrop, schemaUpdate, schemaUpdate
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
SCHEMA_VERSION_PROPERTY
protected static final String SCHEMA_VERSION_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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)
-
getDbSqlSession
public DbSqlSession getDbSqlSession()
-
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.
-
readNextTrimmedLine
protected String readNextTrimmedLine(BufferedReader reader) throws IOException
- Throws:
IOException
-
-