Class AbstractDatabaseVersionService
java.lang.Object
com.avoka.core.service.initialization.AbstractDatabaseVersionService
- Direct Known Subclasses:
DatabaseVersionService
Provides an abstract Database version management service.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
static final String
The database product for MySQLstatic final String
The database product for Oraclestatic final String
The database product for MS SQL Server without Unicode supportstatic final String
The database product for MS SQL Server with Unicode supportprotected static final String
protected static final String
protected static final String
protected org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
createVersionUpdate
(org.apache.cayenne.access.DataContext dataContext, Element updateElement, int rowsUpdated, String updatePerformed, Date finishTime, long updateDuration) protected void
protected abstract String
getAdminConsoleWarVersion
(org.apache.cayenne.access.DataContext dataContext) protected abstract String
protected abstract String
protected abstract String
protected String
getLogFileLocation
(File appserverDirectory) protected abstract String
void
performUpdate
(File appserverDirectory, boolean debugFlag) Perform database schema and data migration update.void
performUpdate
(File appserverDirectory, Set<Integer> skipVersions, boolean debugFlag) Perform database schema and data migration update, with option to skip version execution.
-
Field Details
-
DATABASE_PRODUCT_MYSQL
The database product for MySQL- See Also:
-
DATABASE_PRODUCT_ORACLE
The database product for Oracle- See Also:
-
DATABASE_PRODUCT_SQLSERVER
The database product for MS SQL Server without Unicode support- See Also:
-
DATABASE_PRODUCT_SQLSERVER_UNICODE
The database product for MS SQL Server with Unicode support- See Also:
-
LOG_DIRECTORY_RELATIVE
-
DB_VERSION_FILE_NAME
- See Also:
-
DATETIME_FORMAT
- See Also:
-
ATTRIBUTE_IGNORE_ERRORS
- See Also:
-
logger
protected org.slf4j.Logger logger
-
-
Constructor Details
-
AbstractDatabaseVersionService
public AbstractDatabaseVersionService()
-
-
Method Details
-
performUpdate
Perform database schema and data migration update.- Parameters:
appserverDirectory
- the application server directory, used to determine log file pathdebugFlag
- specify whether to perform debug logging
-
performUpdate
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 pathskipVersions
- skip execution of those versionsdebugFlag
- specify whether to perform debug logging- Since:
- 19.11.0
-
getJndiName
-
getHistoryJndiName
-
getVersionUpdateEntityName
-
getCurrentDatabaseVersions
-
getDatabaseProduct
-
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
-
getLogFileLocation
-