org.apache.torque.mojo
Class SqlMojoBase

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.TexenTaskMojo
          extended by org.apache.torque.mojo.DataModelTaskMojo
              extended by org.apache.torque.mojo.SqlMojoBase
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
IdTableInitSqlMojo, SqlMojo

public abstract class SqlMojoBase
extends DataModelTaskMojo

Generates SQL from the schema.xml files.

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

Field Summary
 
Fields inherited from class org.apache.torque.mojo.DataModelTaskMojo
TARGET_DATABASE_CONTEXT_PROPERTY
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
SqlMojoBase()
          Creates a new SQLMojo object.
 
Method Summary
protected  void configureTask()
          Configures the Texen task which is wrapped by this mojo.
protected  String getControlTemplate()
          Returns the path to the control template.
protected  org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
          Returns the context properties for the Texen task.
 String getSuffix()
          Returns the suffix of the generated sql files.
 void setSuffix(String suffix)
          Sets the suffix of the generated sql files.
 
Methods inherited from class org.apache.torque.mojo.DataModelTaskMojo
execute, getReportFile, getSchemaDir, getSchemaExcludes, getSchemaIncludes, getSqlDbMap, getTargetDatabase, getTargetPackage, isRunOnlyOnSchemaChange, schemaChanged, setReportFile, setRunOnlyOnSchemaChange, setSchemaDir, setSchemaExcludes, setSchemaIncludes, setSqlDbMap, setTargetDatabase, setTargetPackage
 
Methods inherited from class org.apache.torque.mojo.TexenTaskMojo
generateContextProperties, getAntProject, getContextPropertiesPath, getGeneratorTask, getOutputDir, getProject, getTemplatePath, getUseClasspath, getUserContextProperties, setContextPropertiesPath, setGeneratorTask, setOutputDir, setProject, setTemplatePath, setUseClasspath, setUserContextProperties
 
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

SqlMojoBase

public SqlMojoBase()
Creates a new SQLMojo object.

Method Detail

setSuffix

public void setSuffix(String suffix)
Sets the suffix of the generated sql files.

Parameters:
suffix - the suffix of the generated sql files.

getSuffix

public String getSuffix()
Returns the suffix of the generated sql files.

Returns:
the suffix of the generated sql files.

getMojoContextProperties

protected org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
Returns the context properties for the Texen task.

Specified by:
getMojoContextProperties in class TexenTaskMojo
Returns:
The PropertiesConfiguration containing all context properties, not null.

getControlTemplate

protected String getControlTemplate()
Returns the path to the control template.

Specified by:
getControlTemplate in class DataModelTaskMojo
Returns:
"sql/Control.vm"

configureTask

protected void configureTask()
                      throws org.apache.maven.plugin.MojoExecutionException
Configures the Texen task which is wrapped by this mojo. In this implementation, the context properties, useClasspath, the output directory, the control template, the schema Fileset, the target package, the target database and the suffix are set.

Overrides:
configureTask in class DataModelTaskMojo
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs when setting the Tasks properties.
See Also:
TexenTaskMojo.configureTask()


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