|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.velocity.texen.ant.TexenTask
org.apache.torque.task.TorqueDataModelTask
A base torque task that uses either a single XML schema representing a data model, or a <fileset> of XML schemas. We are making the assumption that an XML schema representing a data model contains tables for a single database.
Field Summary | |
private java.lang.String |
basePathToDbProps
The path to properties file containing db idiosyncrasies is constructed by appending the "getTargetDatabase()/db.props to this path. |
protected org.apache.velocity.context.Context |
context
Velocity context which exposes our objects in the templates. |
protected java.util.Hashtable |
databaseNames
Hashtable containing the names of all the databases in our collection of schemas. |
protected java.util.Hashtable |
dataModelDbMap
Map of data model name to database name. |
protected java.util.List |
dataModels
Data models that we collect. |
protected java.util.List |
filesets
Fileset of XML schemas which represent our data models. |
protected java.lang.String |
sqldbmap
Name of the properties file that maps an SQL file to a particular database. |
private java.lang.String |
targetDatabase
The target database(s) we are generating SQL for. |
private java.lang.String |
targetPackage
Target Java package to place the generated files in. |
protected java.lang.String |
xmlFile
XML that describes the database model, this is transformed into the application model object. |
Fields inherited from class org.apache.velocity.texen.ant.TexenTask |
contextProperties, controlTemplate, inputEncoding, outputDirectory, outputEncoding, outputFile, templatePath, useClasspath |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
TorqueDataModelTask()
|
Method Summary | |
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of xml schema files (nested fileset attribute). |
java.lang.String |
getBasePathToDbProps()
The path to properties file containing db idiosyncrasies is constructed by appending the "getTargetDatabase()/db.props to this path. |
java.util.Hashtable |
getDataModelDbMap()
Return the data model to database name map. |
java.util.List |
getDataModels()
Return the data models that have been processed. |
java.lang.String |
getSqlDbMap()
Get the sqldbmap. |
java.lang.String |
getTargetDatabase()
Get the current target database. |
java.lang.String |
getTargetPackage()
Get the current target package. |
java.lang.String |
getXmlFile()
Get the xml schema describing the application model. |
private java.lang.String |
grokName(java.lang.String xmlFile)
Gets a name to use for the application's data model. |
org.apache.velocity.context.Context |
initControlContext()
Set up the initial context for generating the SQL from the XML schema. |
void |
setBasePathToDbProps(java.lang.String v)
The path to properties file containing db idiosyncrasies is constructed by appending the "getTargetDatabase()/db.props to this path. |
void |
setContextProperties(java.lang.String file)
Override Texen's context properties to map the torque.xxx properties (including defaults set by the org/apache/torque/defaults.properties) to just xxx. |
void |
setSqlDbMap(java.lang.String sqldbmap)
Set the sqldbmap. |
void |
setTargetDatabase(java.lang.String v)
Set the current target database. |
void |
setTargetPackage(java.lang.String v)
Set the current target package. |
void |
setXmlFile(java.lang.String xmlFile)
Set the xml schema describing the application model. |
Methods inherited from class org.apache.velocity.texen.ant.TexenTask |
cleanup, execute, getContextProperties, getControlTemplate, getOutputDirectory, getOutputFile, getTemplatePath, populateInitialContext, setControlTemplate, setInputEncoding, setOutputDirectory, setOutputEncoding, setOutputFile, setTemplatePath, setUseClasspath |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String xmlFile
protected java.util.List filesets
protected java.util.List dataModels
protected org.apache.velocity.context.Context context
protected java.util.Hashtable dataModelDbMap
protected java.util.Hashtable databaseNames
protected java.lang.String sqldbmap
private java.lang.String basePathToDbProps
private java.lang.String targetDatabase
private java.lang.String targetPackage
Constructor Detail |
public TorqueDataModelTask()
Method Detail |
public void setSqlDbMap(java.lang.String sqldbmap)
sqldbmap
- th db mappublic java.lang.String getSqlDbMap()
public java.util.List getDataModels()
public java.util.Hashtable getDataModelDbMap()
public java.lang.String getXmlFile()
public void setXmlFile(java.lang.String xmlFile)
xmlFile
- The new XmlFile valuepublic void addFileset(org.apache.tools.ant.types.FileSet set)
set
- a Set of xml schema filespublic java.lang.String getTargetDatabase()
public void setTargetDatabase(java.lang.String v)
v
- target database(s)public java.lang.String getTargetPackage()
public void setTargetPackage(java.lang.String v)
v
- target java package.public java.lang.String getBasePathToDbProps()
public void setBasePathToDbProps(java.lang.String v)
v
- basepath to db.propspublic org.apache.velocity.context.Context initControlContext() throws java.lang.Exception
java.lang.Exception
private java.lang.String grokName(java.lang.String xmlFile)
xmlFile
- The path to the XML file housing the data model.
AppData
.public void setContextProperties(java.lang.String file)
Also, move xxx.yyy properties to xxxYyy as Velocity doesn't like the xxx.yyy syntax.
file
- the file to read the properties from
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |