Java Doc for TorqueDataModelTask.java in  » Database-ORM » Torque » org » apache » torque » task » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque.task 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.torque.task.TorqueDataModelTask

All known Subclasses:   org.apache.torque.task.TorqueDocumentationTask,  org.apache.torque.task.TorqueDataDumpTask,  org.apache.torque.task.TorqueDataSQLTask,  org.apache.torque.task.TorqueSQLTask,
TorqueDataModelTask
public class TorqueDataModelTask extends TexenTask (Code)
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.
author:
   Jason van Zyl
author:
   Daniel Rall

Inner Class :public static class TorqueClasspathResourceLoader extends ClasspathResourceLoader
Inner Class :public static class TorqueFileResourceLoader extends FileResourceLoader

Field Summary
protected  Contextcontext
     Velocity context which exposes our objects in the templates.
protected  HashtabledataModelDbMap
     Map of data model name to database name.
protected  ListdataModels
     Data models that we collect.
protected  HashtabledatabaseNames
     Hashtable containing the names of all the databases in our collection of schemas.
protected  Listfilesets
     Fileset of XML schemas which represent our data models.
protected  Stringsqldbmap
     Name of the properties file that maps an SQL file to a particular database.
protected  StringxmlFile
     XML that describes the database model, this is transformed into the application model object.


Method Summary
public  voidaddFileset(FileSet set)
     Adds a set of xml schema files (nested fileset attribute).
public  voidexecute()
     This method creates an VelocityEngine instance, parses every template and creates the corresponding output. Unfortunately the TextenTask.execute() method makes everything for us but we just want to set our own VelocityTemplateLoader.
protected  InputStreamfilter(InputStream resource)
     This method filters the template and replaces some unwanted characters.
public  HashtablegetDataModelDbMap()
     Return the data model to database name map.
public  ListgetDataModels()
     Return the data models that have been processed.
public  StringgetSqlDbMap()
     Get the sqldbmap.
public  StringgetTargetDatabase()
     Get the current target database.
public  StringgetTargetPackage()
     Get the current target package.
public  StringgetXmlFile()
     Get the xml schema describing the application model.
public  ContextinitControlContext()
     Set up the initial context for generating the SQL from the XML schema.
protected  voidpopulateInitialContext(Context context)
    
public  voidsetContextProperties(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.
public  voidsetSqlDbMap(String sqldbmap)
     Set the sqldbmap.
public  voidsetTargetDatabase(String v)
     Set the current target database.
public  voidsetTargetPackage(String v)
     Set the current target package.
public  voidsetXmlFile(String xmlFile)
     Set the xml schema describing the application model.

Field Detail
context
protected Context context(Code)
Velocity context which exposes our objects in the templates.



dataModelDbMap
protected Hashtable dataModelDbMap(Code)
Map of data model name to database name. Should probably stick to the convention of them being the same but I know right now in a lot of cases they won't be.



dataModels
protected List dataModels(Code)
Data models that we collect. One from each XML schema file.



databaseNames
protected Hashtable databaseNames(Code)
Hashtable containing the names of all the databases in our collection of schemas.



filesets
protected List filesets(Code)
Fileset of XML schemas which represent our data models.



sqldbmap
protected String sqldbmap(Code)
Name of the properties file that maps an SQL file to a particular database.



xmlFile
protected String xmlFile(Code)
XML that describes the database model, this is transformed into the application model object.





Method Detail
addFileset
public void addFileset(FileSet set)(Code)
Adds a set of xml schema files (nested fileset attribute).
Parameters:
  set - a Set of xml schema files



execute
public void execute() throws BuildException(Code)
This method creates an VelocityEngine instance, parses every template and creates the corresponding output. Unfortunately the TextenTask.execute() method makes everything for us but we just want to set our own VelocityTemplateLoader. TODO: change once TEXEN-14 is resolved and out.
See Also:   org.apache.texen.ant.TexenTask.execute



filter
protected InputStream filter(InputStream resource) throws IOException(Code)
This method filters the template and replaces some unwanted characters. For example it removes leading spaces in front of velocity commands and replaces tabs with spaces to prevent bounces in different code editors with different tab-width-setting.
Parameters:
  resource - the input stream to filter the filtered input stream.
throws:
  IOException - if creating, reading or writing to a stream fails.



getDataModelDbMap
public Hashtable getDataModelDbMap()(Code)
Return the data model to database name map. Hashtable data model name to database name map.



getDataModels
public List getDataModels()(Code)
Return the data models that have been processed. List data models



getSqlDbMap
public String getSqlDbMap()(Code)
Get the sqldbmap. String sqldbmap.



getTargetDatabase
public String getTargetDatabase()(Code)
Get the current target database. String target database(s)



getTargetPackage
public String getTargetPackage()(Code)
Get the current target package. return target java package.



getXmlFile
public String getXmlFile()(Code)
Get the xml schema describing the application model. String xml schema file.



initControlContext
public Context initControlContext() throws Exception(Code)
Set up the initial context for generating the SQL from the XML schema. the context
throws:
  Exception -



populateInitialContext
protected void populateInitialContext(Context context) throws Exception(Code)
Change type of "now" to java.util.Date
See Also:   org.apache.texen.ant.TexenTask.populateInitialContext(org.apache.velocity.context.Context)



setContextProperties
public void setContextProperties(String file)(Code)
Override Texen's context properties to map the torque.xxx properties (including defaults set by the org/apache/torque/defaults.properties) to just xxx.

Also, move xxx.yyy properties to xxxYyy as Velocity doesn't like the xxx.yyy syntax.


Parameters:
  file - the file to read the properties from



setSqlDbMap
public void setSqlDbMap(String sqldbmap)(Code)
Set the sqldbmap.
Parameters:
  sqldbmap - th db map



setTargetDatabase
public void setTargetDatabase(String v)(Code)
Set the current target database. (e.g. mysql, oracle, ..)
Parameters:
  v - target database(s)



setTargetPackage
public void setTargetPackage(String v)(Code)
Set the current target package. This is where generated java classes will live.
Parameters:
  v - target java package.



setXmlFile
public void setXmlFile(String xmlFile)(Code)
Set the xml schema describing the application model.
Parameters:
  xmlFile - The new XmlFile value



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.