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.NormalizingStreamNested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType -
Field Summary
Fields inherited from class liquibase.change.AbstractSQLChange
encodingFields inherited from class liquibase.change.AbstractChange
NODENAME_COLUMNFields inherited from interface liquibase.change.Change
EMPTY_CHANGE, SHOULD_EXECUTEFields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACEFields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Output a full description of this object.voidDefault implementation is a no-opCalculates the checksum based on the contained SQL.booleangenerateRollbackStatementsVolatile(Database database) Implementation delegates logic to theSqlGenerator.generateRollbackStatementsIsVolatile(Database)method on theSqlStatementobjects returned byChange.generateStatements(liquibase.database.Database)If no or null SqlStatements are returned by generateRollbackStatements then this method returns false.booleangenerateStatementsVolatile(Database database) Implementation delegates logic to theSqlGenerator.generateStatementsIsVolatile(Database)method on theSqlStatementobjects 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) voidsetDoExpandExpressionsInGenerateChecksum(Boolean doExpandExpressionsInGenerateChecksum) voidsetEncoding(String encoding) voidSets the file name but setUp must be called for the change to have impact.voidsetRelativeToChangelogFile(Boolean relativeToChangelogFile) voidSet 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 theSqlStatementobjects returned byChange.generateStatements(liquibase.database.Database).Methods inherited from class liquibase.change.AbstractSQLChange
checkStatus, generateStatements, getDbms, getEndDelimiter, isIgnoreOriginalSplitStatements, isSplitStatements, isSplitStatementsSet, isStripComments, isStripCommentsUsedDefaultValue, normalizeLineEndings, setDbms, setEndDelimiter, setIgnoreOriginalSplitStatements, setOriginalSplitStatements, setSplitStatements, setStripComments, setStripComments, supports, warnMethods 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, toStringMethods inherited from class liquibase.AbstractExtensibleObject
clone, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, setMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.change.Change
shouldRunOnOsMethods 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:AbstractChangeImplementation delegates logic to theSqlGenerator.generateStatementsIsVolatile(Database)method on theSqlStatementobjects returned byChange.generateStatements(liquibase.database.Database). If zero or null SqlStatements are returned by generateStatements then this method returns false.- Specified by:
generateStatementsVolatilein interfaceChange- Overrides:
generateStatementsVolatilein classAbstractSQLChange
-
generateRollbackStatementsVolatile
Description copied from class:AbstractChangeImplementation delegates logic to theSqlGenerator.generateRollbackStatementsIsVolatile(Database)method on theSqlStatementobjects returned byChange.generateStatements(liquibase.database.Database)If no or null SqlStatements are returned by generateRollbackStatements then this method returns false.- Specified by:
generateRollbackStatementsVolatilein interfaceChange- Overrides:
generateRollbackStatementsVolatilein 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:AbstractChangeDefault implementation is a no-op- Specified by:
finishInitializationin interfaceChange- Overrides:
finishInitializationin classAbstractChange- Throws:
SetupException
-
openSqlStream
- Overrides:
openSqlStreamin classAbstractSQLChange- Throws:
IOException
-
validate
Description copied from class:AbstractChangeImplementation 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 theSqlStatementobjects 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:
validatein interfaceChange- Overrides:
validatein classAbstractSQLChange
-
getConfirmationMessage
Description copied from interface:ChangeConfirmation 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:AbstractSQLChangeReturn the raw SQL managed by this Change- Overrides:
getSqlin classAbstractSQLChange
-
getSql
-
setSql
Description copied from class:AbstractSQLChangeSet the raw SQL managed by this Change. The passed sql is trimmed and set to null if an empty string is passed.- Overrides:
setSqlin classAbstractSQLChange
-
getSerializedObjectNamespace
- Specified by:
getSerializedObjectNamespacein interfaceLiquibaseSerializable- Overrides:
getSerializedObjectNamespacein classAbstractChange
-
describe
Description copied from interface:ExtensibleObjectOutput a full description of this object. Should include all attributes and values.- Specified by:
describein interfaceExtensibleObject- Overrides:
describein classAbstractExtensibleObject
-
generateCheckSum
Description copied from class:AbstractSQLChangeCalculates the checksum based on the contained SQL.- Specified by:
generateCheckSumin interfaceChange- Overrides:
generateCheckSumin classAbstractSQLChange- See Also:
-