org.apache.torque.task
Class TorqueSQLTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.velocity.texen.ant.TexenTask
              extended byorg.apache.torque.task.TorqueDataModelTask
                  extended byorg.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,v 1.2.2.2 2004/05/20 04:35:14 seade Exp $
Author:
Jason van Zyl,
Field Summary
 
Fields inherited from class org.apache.torque.task.TorqueDataModelTask
context, databaseNames, dataModelDbMap, dataModels, filesets, sqldbmap, xmlFile
 
Fields inherited from class org.apache.velocity.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()
           
 java.lang.String getIdTableXMLFile()
          Gets the id-table xml schema file path.
 java.lang.String getSuffix()
           
 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)
           
 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)
           
 
Methods inherited from class org.apache.torque.task.TorqueDataModelTask
addFileset, getBasePathToDbProps, getDataModelDbMap, getDataModels, getSqlDbMap, getTargetDatabase, getTargetPackage, getXmlFile, setBasePathToDbProps, setContextProperties, setSqlDbMap, setTargetDatabase, setTargetPackage, setXmlFile
 
Methods inherited from class org.apache.velocity.texen.ant.TexenTask
cleanup, execute, getContextProperties, getControlTemplate, getLogFile, getOutputDirectory, getOutputFile, getTemplatePath, populateInitialContext, 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)
Parameters:
database -

getDatabase

public java.lang.String getDatabase()
Returns:

setSuffix

public void setSuffix(java.lang.String suffix)
Parameters:
suffix -

getSuffix

public java.lang.String getSuffix()
Returns:

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-2007 Apache Software Foundation. All Rights Reserved.