org.apache.torque.mojo
Class AbstractDBACommandMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.BaseMojo
          extended by org.apache.torque.mojo.AbstractSQLExecutorMojo
              extended by org.apache.torque.mojo.AbstractDBACommandMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ResetMojo, SingleDBACommandMojo

public abstract class AbstractDBACommandMojo
extends AbstractSQLExecutorMojo

Common logic for running SQL commands on a database


Field Summary
static String DATABASE_PROPERTY
           
static String DATABASE_PW_PROPERTY
           
static String DATABASE_USERNAME_PROPERTY
           
 
Fields inherited from class org.apache.torque.mojo.AbstractSQLExecutorMojo
DRIVER_INFO_PROPERTIES_PASSWORD, DRIVER_INFO_PROPERTIES_USER, FILE_SORTING_ASC, FILE_SORTING_DSC
 
Fields inherited from class org.apache.torque.mojo.BaseMojo
FS, SKIP_PACKAGING_TYPE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDBACommandMojo()
           
 
Method Summary
protected  Properties getContextProperties()
           
 String getDatabase()
           
 String getDatabasePassword()
           
 String getDatabaseUser()
           
 String getDbaSettingsKey()
           
protected  org.apache.maven.settings.Server getServerFromSettingsKey()
           
 String getServerUrl()
           
protected  String getTransactionDescription(org.kuali.db.DatabaseCommand command)
           
protected  String getUpdatedPassword(org.apache.maven.settings.Server server, String password)
           
protected  String getUpdatedUsername(org.apache.maven.settings.Server server, String username)
           
 void setDatabase(String schema)
           
 void setDatabasePassword(String databasePassword)
           
 void setDatabaseUser(String databaseUsername)
           
 void setDbaSettingsKey(String dbaSettingsKey)
           
 void setServerUrl(String serverUrl)
           
protected  void updateConfiguration()
          Attempt to automatically detect the correct JDBC driver and database type (oracle, mysql, h2, derby, etc) given a JDBC url
protected  void validateConfiguration()
          Validate that some essential configuration items are present
 
Methods inherited from class org.apache.torque.mojo.AbstractSQLExecutorMojo
addText, configureTransactions, convertNullToEmpty, executeMojo, getConn, getConnection, getCredentials, getDelimiter, getDelimiterType, getDisplayPassword, getDriver, getDriverProperties, getFileFilter, getNewConnectionHandler, getNewCredentials, getOnError, getPassword, getSettingsKey, getSqlCommand, getSqlExecutor, getSrcFiles, getSuccessfulStatements, getTargetDatabase, getTotalStatements, getTransactions, getUrl, getUsername, isAppend, isAutocommit, isEnableAnonymousPassword, isEscapeProcessing, isKeepFormat, isNullOrEmpty, isShowheaders, isShowPassword, isSkipOnConnectionError, setAppend, setAutocommit, setConn, setCredentials, setDelimiter, setDelimiterType, setDriver, setDriverProperties, setEnableAnonymousPassword, setEscapeProcessing, setFileFilter, setKeepFormat, setOnError, setPassword, setSettingsKey, setShowheaders, setShowPassword, setSkipOnConnectionError, setSqlCommand, setSrcFiles, setSuccessfulStatements, setTargetDatabase, setTotalStatements, setTransactions, setUrl, setUsername, updateCredentials, validateCredentials, validateCredentials
 
Methods inherited from class org.apache.torque.mojo.BaseMojo
afterExecution, beforeExecution, execute, getEncoding, getMavenSession, getProject, getSettings, isForceMojoExecution, isSkip, isStartMavenLogger, setEncoding, setForceMojoExecution, setMavenSession, setProject, setSettings, setSkip, setStartMavenLogger, skipMojo
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATABASE_PROPERTY

public static final String DATABASE_PROPERTY
See Also:
Constant Field Values

DATABASE_PW_PROPERTY

public static final String DATABASE_PW_PROPERTY
See Also:
Constant Field Values

DATABASE_USERNAME_PROPERTY

public static final String DATABASE_USERNAME_PROPERTY
See Also:
Constant Field Values
Constructor Detail

AbstractDBACommandMojo

public AbstractDBACommandMojo()
Method Detail

getTransactionDescription

protected String getTransactionDescription(org.kuali.db.DatabaseCommand command)

updateConfiguration

protected void updateConfiguration()
                            throws org.apache.maven.plugin.MojoExecutionException
Description copied from class: AbstractSQLExecutorMojo
Attempt to automatically detect the correct JDBC driver and database type (oracle, mysql, h2, derby, etc) given a JDBC url

Overrides:
updateConfiguration in class AbstractSQLExecutorMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

getUpdatedPassword

protected String getUpdatedPassword(org.apache.maven.settings.Server server,
                                    String password)
Overrides:
getUpdatedPassword in class AbstractSQLExecutorMojo

getUpdatedUsername

protected String getUpdatedUsername(org.apache.maven.settings.Server server,
                                    String username)
Overrides:
getUpdatedUsername in class AbstractSQLExecutorMojo

getContextProperties

protected Properties getContextProperties()
Overrides:
getContextProperties in class AbstractSQLExecutorMojo

getServerFromSettingsKey

protected org.apache.maven.settings.Server getServerFromSettingsKey()
Overrides:
getServerFromSettingsKey in class AbstractSQLExecutorMojo

validateConfiguration

protected void validateConfiguration()
                              throws org.apache.maven.plugin.MojoExecutionException
Description copied from class: AbstractSQLExecutorMojo
Validate that some essential configuration items are present

Overrides:
validateConfiguration in class AbstractSQLExecutorMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

getDatabase

public String getDatabase()

setDatabase

public void setDatabase(String schema)

getDatabasePassword

public String getDatabasePassword()

setDatabasePassword

public void setDatabasePassword(String databasePassword)

getDatabaseUser

public String getDatabaseUser()

setDatabaseUser

public void setDatabaseUser(String databaseUsername)

getServerUrl

public String getServerUrl()

setServerUrl

public void setServerUrl(String serverUrl)

getDbaSettingsKey

public String getDbaSettingsKey()

setDbaSettingsKey

public void setDbaSettingsKey(String dbaSettingsKey)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.