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 or not to check for existing tables before generating SQLprotected booleanWhether or not to generate the SQL in a 'readable format' -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.TransactionTemplatefinal inthashCode()booleanbooleanbooleanisDryRun()protected booleanbooleanbooleanprotected voidorg.springframework.jdbc.core.JdbcTemplatesetConnectionProperties(DriverTypeEnum.ConnectionProperties theConnectionProperties) setDescription(String theDescription) setDoNothing(boolean theDoNothing) setDriverType(DriverTypeEnum theDriverType) voidsetDryRun(boolean theDryRun) voidsetFailureAllowed(boolean theFailureAllowed) voidsetNoColumnShrink(boolean theNoColumnShrink) voidsetOnlyAppliesToPlatforms(Set<DriverTypeEnum> theOnlyAppliesToPlatforms) voidsetPrettyPrint(boolean thePrettyPrint) voidsetRunDuringSchemaInitialization(boolean theRunDuringSchemaInitialization) Should this task run even if we're doing the very first initialization of an empty schema.voidsetTransactional(boolean theTransactional) Some migrations can not be run in a transaction.abstract voidvalidate()void
-
Field Details
-
MIGRATION_VERSION_PATTERN
- See Also:
-
myCheckForExistingTables
Whether or not to check for existing tables before generating SQL -
myPrettyPrint
Whether or not to generate the SQL in a 'readable format'
-
-
Constructor Details
-
BaseTask
-
-
Method Details
-
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 -
isRunDuringSchemaInitialization
-
setPrettyPrint
-
setRunDuringSchemaInitialization
Should this task run even if we're doing the very first initialization of an empty schema. By default we skip most tasks during that pass, since they just take up time and the schema should be fully initialized by theInitializeSchemaTask -
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
-
getConnectionProperties
-
setConnectionProperties
public BaseTask setConnectionProperties(DriverTypeEnum.ConnectionProperties theConnectionProperties) -
getDriverType
-
setDriverType
-
validate
-
getTxTemplate
-
newJdbcTemplate
-
execute
- Throws:
SQLException
-
doExecute
- Throws:
SQLException
-
isFailureAllowed
-
setFailureAllowed
-
getMigrationVersion
-
logInfo
-
validateVersion
-
isDoNothing
-
setDoNothing
-
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
-