liquibase.change.core
Class SQLFileChange

java.lang.Object
  extended by liquibase.change.AbstractChange
      extended by liquibase.change.AbstractSQLChange
          extended by liquibase.change.core.SQLFileChange
All Implemented Interfaces:
Change

public class SQLFileChange
extends AbstractSQLChange

Represents a Change for custom SQL stored in a File.

To create an instance call the constructor as normal and then call

Author:
Paul Keeble

Constructor Summary
SQLFileChange()
           
 
Method Summary
 CheckSum generateCheckSum()
          Calculates an MD5 from the contents of the file.
 java.lang.String getConfirmationMessage()
           
 java.lang.String getEncoding()
          The encoding of the file containing SQL statements
 java.lang.String getPath()
           
 void init()
          Most Changes don't need to do any setup.
 java.lang.Boolean isRelativeToChangelogFile()
           
 void setEncoding(java.lang.String encoding)
           
 void setPath(java.lang.String fileName)
          Sets the file name but setUp must be called for the change to have impact.
 void setRelativeToChangelogFile(java.lang.Boolean relativeToChangelogFile)
           
 ValidationErrors validate(Database database)
           
 Warnings warn(Database database)
           
 
Methods inherited from class liquibase.change.AbstractSQLChange
generateStatements, getEndDelimiter, getSql, isSplittingStatements, isStrippingComments, setEndDelimiter, setSplitStatements, setSql, setStripComments, supports
 
Methods inherited from class liquibase.change.AbstractChange
createInverses, generateRollbackStatements, getAffectedDatabaseObjects, getChangeMetaData, getChangeSet, getResourceAccessor, requiresUpdatedDatabaseMetadata, setChangeSet, setPriority, setResourceAccessor, supportsRollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLFileChange

public SQLFileChange()
Method Detail

getPath

public java.lang.String getPath()

setPath

public void setPath(java.lang.String fileName)
Sets the file name but setUp must be called for the change to have impact.

Parameters:
fileName - The file to use

getEncoding

public java.lang.String getEncoding()
The encoding of the file containing SQL statements

Returns:
the encoding

setEncoding

public void setEncoding(java.lang.String encoding)
Parameters:
encoding - the encoding to set

isRelativeToChangelogFile

public java.lang.Boolean isRelativeToChangelogFile()

setRelativeToChangelogFile

public void setRelativeToChangelogFile(java.lang.Boolean relativeToChangelogFile)

init

public void init()
          throws SetupException
Description copied from class: AbstractChange
Most Changes don't need to do any setup. This implements a no-op

Specified by:
init in interface Change
Overrides:
init in class AbstractChange
Throws:
SetupException

validate

public ValidationErrors validate(Database database)
Specified by:
validate in interface Change
Overrides:
validate in class AbstractChange

warn

public Warnings warn(Database database)
Specified by:
warn in interface Change
Overrides:
warn in class AbstractChange

generateCheckSum

public CheckSum generateCheckSum()
Calculates an MD5 from the contents of the file.

Specified by:
generateCheckSum in interface Change
Overrides:
generateCheckSum in class AbstractChange
See Also:
AbstractChange.generateCheckSum()

getConfirmationMessage

public java.lang.String getConfirmationMessage()
Returns:
Confirmation message to be displayed after the change is executed


Copyright © 2011 Liquibase.org. All Rights Reserved.