liquibase.change
Class SQLFileChange

java.lang.Object
  extended by liquibase.change.AbstractChange
      extended by liquibase.change.AbstractSQLChange
          extended by liquibase.change.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
 org.w3c.dom.Element createNode(org.w3c.dom.Document currentChangeLogDOM)
          Creates an XML element (of type Node) of the change object, and adds it to the Document object passed as argument
 java.util.Set<DatabaseObject> getAffectedDatabaseObjects()
           
 java.lang.String getConfirmationMessage()
          Confirmation message to be displayed after the change is executed
 java.lang.String getEncoding()
          The encoding of the file containing SQL statements
 java.lang.String getMD5Sum()
          Calculates an MD5 from the contents of the file.
 java.lang.String getPath()
           
 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 setUp()
          Most Changes don't need to do any setup.
 
Methods inherited from class liquibase.change.AbstractSQLChange
generateStatements, getEndDelimiter, getSql, isSplittingStatements, isStrippingComments, setEndDelimiter, setSplitStatements, setSql, setStripComments, validate
 
Methods inherited from class liquibase.change.AbstractChange
canRollBack, createInverses, executeRollbackStatements, executeStatements, generateRollbackStatements, getChangeName, getChangeSet, getFileOpener, getTagName, saveRollbackStatement, saveStatements, setChangeSet, setFileOpener
 
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

setUp

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

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

getMD5Sum

public java.lang.String getMD5Sum()
Calculates an MD5 from the contents of the file.

Specified by:
getMD5Sum in interface Change
Overrides:
getMD5Sum in class AbstractChange
Returns:
the MD5 hash
See Also:
AbstractChange.getMD5Sum()

createNode

public org.w3c.dom.Element createNode(org.w3c.dom.Document currentChangeLogDOM)
Description copied from interface: Change
Creates an XML element (of type Node) of the change object, and adds it to the Document object passed as argument

Parameters:
currentChangeLogDOM - the current Document where this element is being added
Returns:
the Node object created

getConfirmationMessage

public java.lang.String getConfirmationMessage()
Description copied from interface: Change
Confirmation message to be displayed after the change is executed

Returns:
a String containing the message after the change is executed

getAffectedDatabaseObjects

public java.util.Set<DatabaseObject> getAffectedDatabaseObjects()