Package liquibase.change.core
Class SQLFileChange
java.lang.Object
liquibase.AbstractExtensibleObject
liquibase.plugin.AbstractPlugin
liquibase.change.AbstractChange
liquibase.change.AbstractSQLChange
liquibase.change.core.SQLFileChange
- All Implemented Interfaces:
Cloneable
,Change
,DbmsTargetedChange
,ExtensibleObject
,Plugin
,LiquibaseSerializable
Represents a Change for custom SQL stored in a File.
-
Nested Class Summary
Nested classes/interfaces inherited from class liquibase.change.AbstractSQLChange
AbstractSQLChange.NormalizingStream
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
-
Field Summary
Fields inherited from class liquibase.change.AbstractSQLChange
encoding
Fields inherited from class liquibase.change.AbstractChange
NODENAME_COLUMN
Fields inherited from interface liquibase.change.Change
EMPTY_CHANGE, SHOULD_EXECUTE
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondescribe()
Output a full description of this object.void
Default implementation is a no-opCalculates the checksum based on the contained SQL.boolean
generateRollbackStatementsVolatile
(Database database) Implementation delegates logic to theSqlGenerator.generateRollbackStatementsIsVolatile(Database)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
If no or null SqlStatements are returned by generateRollbackStatements then this method returns false.boolean
generateStatementsVolatile
(Database database) Implementation delegates logic to theSqlGenerator.generateStatementsIsVolatile(Database)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
.Confirmation message to be displayed after the change is executed.The encoding of the file containing SQL statementsgetPath()
getSql()
Return the raw SQL managed by this ChangegetSql
(boolean doExpandExpressions) void
setDoExpandExpressionsInGenerateChecksum
(Boolean doExpandExpressionsInGenerateChecksum) void
setEncoding
(String encoding) void
Sets the file name but setUp must be called for the change to have impact.void
setRelativeToChangelogFile
(Boolean relativeToChangelogFile) void
Set the raw SQL managed by this Change.Implementation checks the ChangeParameterMetaData for declared required fields and also delegates logic to theSqlGenerator.validate(liquibase.statement.SqlStatement, liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
.Methods inherited from class liquibase.change.AbstractSQLChange
checkStatus, generateStatements, getDbms, getEndDelimiter, isIgnoreOriginalSplitStatements, isSplitStatements, isSplitStatementsSet, isStripComments, normalizeLineEndings, setDbms, setEndDelimiter, setIgnoreOriginalSplitStatements, setOriginalSplitStatements, setSplitStatements, setStripComments, setStripComments, supports, warn
Methods inherited from class liquibase.change.AbstractChange
createAlternateParameterNames, createChangeMetaData, createChangeParameterMetadata, createDescriptionMetaData, createEmptyColumnConfig, createExampleValueMetaData, createInverses, createMustEqualExistingMetaData, createRequiredDatabasesMetaData, createSerializationTypeMetaData, createSinceMetaData, createSupportedDatabasesMetaData, customLoadLogic, equals, generateRollbackStatements, getAffectedDatabaseObjects, getChangeSet, getDescription, getExcludedFieldFilters, getResourceAccessor, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, hashCode, isInvalidProperty, load, modify, serialize, serializeValue, setChangeSet, setResourceAccessor, shouldExecuteChange, supportsRollback, toString
Methods inherited from class liquibase.AbstractExtensibleObject
clone, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, set
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface liquibase.ExtensibleObject
clone, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
-
Constructor Details
-
SQLFileChange
public SQLFileChange()
-
-
Method Details
-
generateStatementsVolatile
Description copied from class:AbstractChange
Implementation delegates logic to theSqlGenerator.generateStatementsIsVolatile(Database)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
. If zero or null SqlStatements are returned by generateStatements then this method returns false.- Specified by:
generateStatementsVolatile
in interfaceChange
- Overrides:
generateStatementsVolatile
in classAbstractSQLChange
-
generateRollbackStatementsVolatile
Description copied from class:AbstractChange
Implementation delegates logic to theSqlGenerator.generateRollbackStatementsIsVolatile(Database)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
If no or null SqlStatements are returned by generateRollbackStatements then this method returns false.- Specified by:
generateRollbackStatementsVolatile
in interfaceChange
- Overrides:
generateRollbackStatementsVolatile
in classAbstractSQLChange
-
getPath
-
setPath
Sets the file name but setUp must be called for the change to have impact.- Parameters:
fileName
- The file to use
-
getEncoding
The encoding of the file containing SQL statements- Returns:
- the encoding
-
setEncoding
- Parameters:
encoding
- the encoding to set
-
isRelativeToChangelogFile
-
setRelativeToChangelogFile
-
setDoExpandExpressionsInGenerateChecksum
-
finishInitialization
Description copied from class:AbstractChange
Default implementation is a no-op- Specified by:
finishInitialization
in interfaceChange
- Overrides:
finishInitialization
in classAbstractChange
- Throws:
SetupException
-
openSqlStream
- Overrides:
openSqlStream
in classAbstractSQLChange
- Throws:
IOException
-
validate
Description copied from class:AbstractChange
Implementation checks the ChangeParameterMetaData for declared required fields and also delegates logic to theSqlGenerator.validate(liquibase.statement.SqlStatement, liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)
method on theSqlStatement
objects returned byChange.generateStatements(liquibase.database.Database)
. If no or null SqlStatements are returned by generateStatements then this method returns no errors. If there are no parameters than this method returns no errors- Specified by:
validate
in interfaceChange
- Overrides:
validate
in classAbstractSQLChange
-
getConfirmationMessage
Description copied from interface:Change
Confirmation message to be displayed after the change is executed. Should include relevant configuration settings to make it as helpful as possible. This method may be called outside the changelog execution process, such as in documentation generation. -
getSql
Description copied from class:AbstractSQLChange
Return the raw SQL managed by this Change- Overrides:
getSql
in classAbstractSQLChange
-
getSql
-
setSql
Description copied from class:AbstractSQLChange
Set the raw SQL managed by this Change. The passed sql is trimmed and set to null if an empty string is passed.- Overrides:
setSql
in classAbstractSQLChange
-
getSerializedObjectNamespace
- Specified by:
getSerializedObjectNamespace
in interfaceLiquibaseSerializable
- Overrides:
getSerializedObjectNamespace
in classAbstractChange
-
describe
Description copied from interface:ExtensibleObject
Output a full description of this object. Should include all attributes and values.- Specified by:
describe
in interfaceExtensibleObject
- Overrides:
describe
in classAbstractExtensibleObject
-
generateCheckSum
Description copied from class:AbstractSQLChange
Calculates the checksum based on the contained SQL.- Specified by:
generateCheckSum
in interfaceChange
- Overrides:
generateCheckSum
in classAbstractSQLChange
- See Also:
-