org.apache.torque.mojo
Class SqlExecMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.SqlExecMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class SqlExecMojo
extends org.apache.maven.plugin.AbstractMojo

Executes the generated SQL.

Author:
Raphael Pieroni (rafale_at_codehaus.org), Thomas Fischer

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
SqlExecMojo()
          Creates and initializes a SqlExecMojo.
 
Method Summary
protected  void configureTask()
          Transfers the settings in this Mojo to the encapsulated ant task.
 void execute()
          Executes the goal of this mojo.
 String getDelimiter()
          The delimiter used to separate SQL commands.
 String getDelimiterType()
          Returns whether the delimiter can be anywhere in the sql ("normal") or needs to be in an extra row ("row").
 String getDriver()
          Returns the fully qualified class name of the database driver.
 String getOnError()
          Returns whether to procede if an sql error occurs during execution.
 String getPassword()
          Returns the password of the database user.
 String getSqlDbMap()
          Returns the path to the mapping SQL Files -> database.
 String getSrcDir()
          Returns the path to the directory where the sql files can be found.
 String getUrl()
          Returns the connect URL to the database.
 String getUser()
          Returns the database user.
 boolean isAutocommit()
          Returns whether autocommit is turned on.
 void setAutocommit(boolean autocommit)
          Sets whether autocommit is turned on.
 void setDelimiter(String delimiter)
          Sets the delimiter used to separate SQL commands.
 void setDelimiterType(String delimiterType)
          Sets whether the delimiter can be anywhere in the sql ("normal") or needs to be in an extra row ("row").
 void setDriver(String driver)
          Sets the fully qualified class name of the database driver.
 void setOnError(String onError)
          Tells the task whether to procede if an sql error occurs during execution.
 void setPassword(String password)
          Sets the password of the database user.
 void setSqlDbMap(String sqlDbMap)
          Sets the path to the mapping SQL Files -> database.
 void setSrcDir(String srcDir)
          Sets the path to the directory where the sql files can be found.
 void setUrl(String url)
          Sets the connect URL to the database.
 void setUser(String user)
          Sets the database user.
 
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
 

Constructor Detail

SqlExecMojo

public SqlExecMojo()
Creates and initializes a SqlExecMojo.

Method Detail

isAutocommit

public boolean isAutocommit()
Returns whether autocommit is turned on.

Returns:
true if autocommit is on, false otherwise.

setAutocommit

public void setAutocommit(boolean autocommit)
Sets whether autocommit is turned on.

Parameters:
autocommit - true to turn autocommit on, false to turn it off.

getDelimiter

public String getDelimiter()
The delimiter used to separate SQL commands.

Returns:
the delimiter used to separate SQL commands.

setDelimiter

public void setDelimiter(String delimiter)
Sets the delimiter used to separate SQL commands.

Parameters:
delimiter - the delimiter used to separate SQL commands.

getDelimiterType

public String getDelimiterType()
Returns whether the delimiter can be anywhere in the sql ("normal") or needs to be in an extra row ("row").

Returns:
the delimiter type.

setDelimiterType

public void setDelimiterType(String delimiterType)
Sets whether the delimiter can be anywhere in the sql ("normal") or needs to be in an extra row ("row").

Parameters:
delimiterType - the delimiter type, should either be "normal" or "row".

getDriver

public String getDriver()
Returns the fully qualified class name of the database driver.

Returns:
the fully qualified class name of the database driver.

setDriver

public void setDriver(String driver)
Sets the fully qualified class name of the database driver.

Parameters:
driver - the fully qualified class name of the database driver.

getPassword

public String getPassword()
Returns the password of the database user.

Returns:
the password of the database user.

setPassword

public void setPassword(String password)
Sets the password of the database user.

Parameters:
password - the password of the database user.

getUrl

public String getUrl()
Returns the connect URL to the database.

Returns:
the connect URL to the database.

setUrl

public void setUrl(String url)
Sets the connect URL to the database.

Parameters:
url - the connect URL to the database.

getUser

public String getUser()
Returns the database user.

Returns:
the userId of the database user.

setUser

public void setUser(String user)
Sets the database user.

Parameters:
user - the userId of the database user.

getSqlDbMap

public String getSqlDbMap()
Returns the path to the mapping SQL Files -> database.

Returns:
the path to the mapping SQL Files -> database.

setSqlDbMap

public void setSqlDbMap(String sqlDbMap)
Sets the path to the mapping SQL Files -> database.

Parameters:
sqlDbMap - the absolute path to the mapping SQL Files -> database.

getOnError

public String getOnError()
Returns whether to procede if an sql error occurs during execution.

Returns:
onError what to do in case of an sql error, can be one of "continue", "stop" or "abort".

setOnError

public void setOnError(String onError)
Tells the task whether to procede if an sql error occurs during execution. Can be either "continue", "stop" or "abort".

Parameters:
onError - what to do in case of an sql error.

getSrcDir

public String getSrcDir()
Returns the path to the directory where the sql files can be found.

Returns:
the source directory where to find the SQL files.

setSrcDir

public void setSrcDir(String srcDir)
Sets the path to the directory where the sql files can be found.

Parameters:
srcDir - the source directory where to find the SQL files.

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Executes the goal of this mojo.

Throws:
org.apache.maven.plugin.MojoExecutionException - if the execution fails.
See Also:
Mojo.execute()

configureTask

protected void configureTask()
Transfers the settings in this Mojo to the encapsulated ant task.



Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.