org.apache.torque.task
Class TorqueSQLTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.texen.ant.TexenTask
              extended by org.apache.torque.task.TorqueDataModelTask
                  extended by org.apache.torque.task.TorqueSQLTask
All Implemented Interfaces:
java.lang.Cloneable

public class TorqueSQLTask
extends TorqueDataModelTask

An extended Texen task used for generating SQL source from an XML schema describing a database structure.

Version:
$Id: TorqueSQLTask.java 591762 2007-11-04 11:22:06Z tfischer $
Author:
Jason van Zyl,
Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.torque.task.TorqueDataModelTask
TorqueDataModelTask.TorqueClasspathResourceLoader, TorqueDataModelTask.TorqueFileResourceLoader
 
Field Summary
 
Fields inherited from class org.apache.torque.task.TorqueDataModelTask
context, databaseNames, dataModelDbMap, dataModels, filesets, sqldbmap, xmlFile
 
Fields inherited from class org.apache.texen.ant.TexenTask
contextProperties, controlTemplate, inputEncoding, logFile, outputDirectory, outputEncoding, outputFile, resourceLoaderModificationCheckInterval, templatePath, useClasspath, useResourceLoaderCache
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
TorqueSQLTask()
           
 
Method Summary
 java.lang.String getDatabase()
          Returns the name of the database to generate sql for.
 java.lang.String getIdTableXMLFile()
          Gets the id-table xml schema file path.
 java.lang.String getSuffix()
          Returns the suffix of the generated sql files.
 org.apache.velocity.context.Context initControlContext()
          Place our target database and target platform values into the context for use in the templates.
 void loadIdBrokerModel()
          Create the database model necessary for the IDBroker tables.
 void setDatabase(java.lang.String database)
          Sets the name of the database to generate sql for.
 void setIdTableXMLFile(java.lang.String idXmlFile)
          Set the path to the xml schema file that defines the id-table, used by the idbroker method.
 void setSuffix(java.lang.String suffix)
          Sets the suffix of the generated sql files.
 
Methods inherited from class org.apache.torque.task.TorqueDataModelTask
addFileset, execute, filter, getDataModelDbMap, getDataModels, getSqlDbMap, getTargetDatabase, getTargetPackage, getXmlFile, populateInitialContext, setContextProperties, setSqlDbMap, setTargetDatabase, setTargetPackage, setXmlFile
 
Methods inherited from class org.apache.texen.ant.TexenTask
cleanup, getContextProperties, getControlTemplate, getLogFile, getOutputDirectory, getOutputFile, getTemplatePath, setControlTemplate, setInputEncoding, setLogFile, setOutputDirectory, setOutputEncoding, setOutputFile, setResourceLoaderModificationCheckInterval, setTemplatePath, setUseClasspath, setUseResourceLoaderCache
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TorqueSQLTask

public TorqueSQLTask()
Method Detail

setDatabase

public void setDatabase(java.lang.String database)
Sets the name of the database to generate sql for.

Parameters:
database - the name of the database to generate sql for.

getDatabase

public java.lang.String getDatabase()
Returns the name of the database to generate sql for.

Returns:
the name of the database to generate sql for.

setSuffix

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

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

getSuffix

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

Returns:
the suffix of the generated sql files.

setIdTableXMLFile

public void setIdTableXMLFile(java.lang.String idXmlFile)
Set the path to the xml schema file that defines the id-table, used by the idbroker method.

Parameters:
idXmlFile - xml schema file

getIdTableXMLFile

public java.lang.String getIdTableXMLFile()
Gets the id-table xml schema file path.

Returns:
Path to file.

loadIdBrokerModel

public void loadIdBrokerModel()
                       throws EngineException
Create the database model necessary for the IDBroker tables. We use the model to generate the necessary SQL to create these tables. This method adds an AppData object containing the model to the context under the name "idmodel".

Throws:
EngineException

initControlContext

public org.apache.velocity.context.Context initControlContext()
                                                       throws java.lang.Exception
Place our target database and target platform values into the context for use in the templates.

Overrides:
initControlContext in class TorqueDataModelTask
Returns:
the context
Throws:
java.lang.Exception


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