Package ca.uhn.fhir.jpa.migrate.taskdef
Class BaseTask
java.lang.Object
ca.uhn.fhir.jpa.migrate.taskdef.BaseTask
- Direct Known Subclasses:
AddIdGeneratorTask,ArbitrarySqlTask,BaseTableTask,DropIdGeneratorTask,ExecuteRawSqlTask,ForceIdMigrationCopyTask,ForceIdMigrationFixTask,InitializeSchemaTask,NopTask
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected booleanWhether to check for existing tables before generating SQLprotected booleanWhether to generate the SQL in a 'readable format' -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFlag(TaskFlagEnum theFlag) Adds a flag if it's not already present, otherwise this call is ignored.voidaddPrecondition(ExecuteTaskPrecondition thePrecondition) protected voidcaptureExecutedStatement(String theTableName, String theSql, Object... theArguments) protected abstract voidfinal booleanvoidexecute()voidexecuteSql(String theTableName, String theSql, Object... theArguments) protected voidexecuteSqlListInTransaction(String theTableName, List<String> theSqlStatements) protected abstract voidgenerateEquals(org.apache.commons.lang3.builder.EqualsBuilder theBuilder, BaseTask theOtherObject) protected abstract voidgenerateHashCode(org.apache.commons.lang3.builder.HashCodeBuilder theBuilder) intorg.springframework.transaction.support.TransactionTemplatebooleanhasFlag(TaskFlagEnum theFlag) final inthashCode()booleanbooleanbooleanisDryRun()booleanbooleanprotected voidorg.springframework.jdbc.core.JdbcTemplatesetConnectionProperties(DriverTypeEnum.ConnectionProperties theConnectionProperties) setDescription(String theDescription) setDriverType(DriverTypeEnum theDriverType) voidsetDryRun(boolean theDryRun) voidsetNoColumnShrink(boolean theNoColumnShrink) voidsetOnlyAppliesToPlatforms(Set<DriverTypeEnum> theOnlyAppliesToPlatforms) voidsetPrettyPrint(boolean thePrettyPrint) voidsetTransactional(boolean theTransactional) Some migrations can not be run in a transaction.toString()abstract voidvalidate()void
-
Field Details
-
MIGRATION_VERSION_PATTERN
- See Also:
-
myCheckForExistingTables
Whether to check for existing tables before generating SQL -
myPrettyPrint
Whether to generate the SQL in a 'readable format'
-
-
Constructor Details
-
BaseTask
-
-
Method Details
-
addFlag
Adds a flag if it's not already present, otherwise this call is ignored.- Parameters:
theFlag- The flag, must not be null
-
setTransactional
Some migrations can not be run in a transaction. When this is true,executeSql(java.lang.String, java.lang.String, java.lang.Object...)will run without a transaction -
setPrettyPrint
-
setOnlyAppliesToPlatforms
-
getProductVersion
-
getSchemaVersion
-
isNoColumnShrink
-
setNoColumnShrink
-
isDryRun
-
setDryRun
-
getDescription
-
setDescription
-
getExecutedStatements
-
getChangesCount
-
executeSql
- Parameters:
theTableName- This is only used for logging currentlytheSql- The SQL statementtheArguments- The SQL statement arguments
-
executeSqlListInTransaction
-
captureExecutedStatement
protected void captureExecutedStatement(String theTableName, @Language("SQL") String theSql, Object... theArguments) -
getConnectionProperties
-
setConnectionProperties
public BaseTask setConnectionProperties(DriverTypeEnum.ConnectionProperties theConnectionProperties) -
getDriverType
-
setDriverType
-
validate
-
getTxTemplate
-
newJdbcTemplate
-
execute
- Throws:
SQLException
-
toString
-
doExecute
- Throws:
SQLException
-
getMigrationVersion
-
logInfo
-
validateVersion
-
addPrecondition
-
hashCode
-
generateHashCode
protected abstract void generateHashCode(org.apache.commons.lang3.builder.HashCodeBuilder theBuilder) -
equals
-
generateEquals
protected abstract void generateEquals(org.apache.commons.lang3.builder.EqualsBuilder theBuilder, BaseTask theOtherObject) -
initializedSchema
-
isDoNothing
-
isHeavyweightSkippableTask
-
hasFlag
-
getExecutionResult
-