org.apache.ibatis.migration.commands
Class BaseCommand

java.lang.Object
  extended by org.apache.ibatis.migration.commands.BaseCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
BootstrapCommand, DownCommand, InitializeCommand, NewCommand, PendingCommand, ScriptCommand, StatusCommand, UpCommand, VersionCommand

public abstract class BaseCommand
extends Object
implements Command


Field Summary
protected  File basePath
           
protected  File driverPath
           
protected  String environment
           
protected  File envPath
           
protected  boolean force
           
protected  PrintStream printStream
           
protected  File scriptPath
           
 
Constructor Summary
protected BaseCommand(File repository, String environment, boolean force)
           
 
Method Summary
protected  File baseFile(String fileName)
           
protected  boolean changelogExists()
           
protected  String changelogTable()
           
protected  void copyResourceTo(String resource, File toFile)
           
protected  void copyResourceTo(String resource, File toFile, Properties variables)
           
protected  File driverFile(String fileName)
           
protected  File environmentFile()
           
protected  File environmentFile(String fileName)
           
protected  Properties environmentProperties()
           
protected  File existingEnvironmentFile()
           
protected  String generateAppliedTimeStampAsString()
           
protected  List<Change> getChangelog()
           
 ClassLoader getDriverClassLoader()
           
protected  Change getLastAppliedChange()
           
protected  List<Change> getMigrations()
           
protected  String getNextIDAsString()
           
 PrintStream getPrintStream()
           
protected  ScriptRunner getScriptRunner()
           
protected  SqlRunner getSqlRunner()
           
protected  int getStepCountParameter(int defaultSteps, String... params)
           
protected  String horizontalLine(String caption, int length)
           
protected  void insertChangelog(Change change)
           
protected  boolean paramsEmpty(String... params)
           
protected  File scriptFile(String fileName)
           
 void setDriverClassLoader(ClassLoader driverClassLoader)
           
 void setPrintStream(PrintStream printStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ibatis.migration.commands.Command
execute
 

Field Detail

printStream

protected PrintStream printStream

basePath

protected File basePath

envPath

protected File envPath

scriptPath

protected File scriptPath

driverPath

protected File driverPath

environment

protected String environment

force

protected boolean force
Constructor Detail

BaseCommand

protected BaseCommand(File repository,
                      String environment,
                      boolean force)
Method Detail

getPrintStream

public PrintStream getPrintStream()

setPrintStream

public void setPrintStream(PrintStream printStream)

getDriverClassLoader

public ClassLoader getDriverClassLoader()

setDriverClassLoader

public void setDriverClassLoader(ClassLoader driverClassLoader)

paramsEmpty

protected boolean paramsEmpty(String... params)

getMigrations

protected List<Change> getMigrations()

getChangelog

protected List<Change> getChangelog()

changelogTable

protected String changelogTable()

getLastAppliedChange

protected Change getLastAppliedChange()

changelogExists

protected boolean changelogExists()

horizontalLine

protected String horizontalLine(String caption,
                                int length)

getNextIDAsString

protected String getNextIDAsString()

copyResourceTo

protected void copyResourceTo(String resource,
                              File toFile)

copyResourceTo

protected void copyResourceTo(String resource,
                              File toFile,
                              Properties variables)

getSqlRunner

protected SqlRunner getSqlRunner()

getScriptRunner

protected ScriptRunner getScriptRunner()

baseFile

protected File baseFile(String fileName)

environmentFile

protected File environmentFile(String fileName)

scriptFile

protected File scriptFile(String fileName)

driverFile

protected File driverFile(String fileName)

environmentFile

protected File environmentFile()

existingEnvironmentFile

protected File existingEnvironmentFile()

environmentProperties

protected Properties environmentProperties()

insertChangelog

protected void insertChangelog(Change change)

generateAppliedTimeStampAsString

protected String generateAppliedTimeStampAsString()

getStepCountParameter

protected int getStepCountParameter(int defaultSteps,
                                    String... params)


Copyright © 2010. All Rights Reserved.