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 Summary
Fields Modifier and Type Field Description protected static String
ATTRIBUTE_IGNORE_ERRORS
static String
DATABASE_PRODUCT_MYSQL
The database product for MySQLstatic String
DATABASE_PRODUCT_ORACLE
The database product for Oraclestatic String
DATABASE_PRODUCT_SQLSERVER
The database product for MS SQL Server without Unicode supportstatic String
DATABASE_PRODUCT_SQLSERVER_UNICODE
The database product for MS SQL Server with Unicode supportprotected static String
DATETIME_FORMAT
protected static String
DB_VERSION_FILE_NAME
protected static String
LOG_DIRECTORY_RELATIVE
protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description AbstractDatabaseVersionService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
createVersionUpdate(org.apache.cayenne.access.DataContext dataContext, Element updateElement, int rowsUpdated, String updatePerformed, Date finishTime, long updateDuration)
protected void
fail(String message)
protected abstract List<String>
getCurrentDatabaseReleaseVersions()
protected abstract List<Integer>
getCurrentDatabaseVersions()
protected abstract String
getDatabaseProduct()
protected abstract String
getHistoryJndiName()
protected abstract String
getJndiName()
protected String
getLogFileLocation(File appserverDirectory)
protected abstract String
getVersionUpdateEntityName()
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 Detail
-
DATABASE_PRODUCT_MYSQL
public static final String DATABASE_PRODUCT_MYSQL
The database product for MySQL- See Also:
- Constant Field Values
-
DATABASE_PRODUCT_ORACLE
public static final String DATABASE_PRODUCT_ORACLE
The database product for Oracle- See Also:
- Constant Field Values
-
DATABASE_PRODUCT_SQLSERVER
public static final String DATABASE_PRODUCT_SQLSERVER
The database product for MS SQL Server without Unicode support- See Also:
- Constant Field Values
-
DATABASE_PRODUCT_SQLSERVER_UNICODE
public static final String DATABASE_PRODUCT_SQLSERVER_UNICODE
The database product for MS SQL Server with Unicode support- See Also:
- Constant Field Values
-
LOG_DIRECTORY_RELATIVE
protected static final String LOG_DIRECTORY_RELATIVE
-
DB_VERSION_FILE_NAME
protected static final String DB_VERSION_FILE_NAME
- See Also:
- Constant Field Values
-
DATETIME_FORMAT
protected static final String DATETIME_FORMAT
- See Also:
- Constant Field Values
-
ATTRIBUTE_IGNORE_ERRORS
protected static final String ATTRIBUTE_IGNORE_ERRORS
- See Also:
- Constant Field Values
-
logger
protected org.slf4j.Logger logger
-
-
Method Detail
-
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 pathdebugFlag
- 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 pathskipVersions
- skip execution of those versionsdebugFlag
- 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()
-
getDatabaseProduct
protected abstract String getDatabaseProduct()
-
getCurrentDatabaseReleaseVersions
protected abstract List<String> getCurrentDatabaseReleaseVersions()
-
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)
-
-