You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/09/13 11:44:53 UTC
cvs commit: jakarta-commons-sandbox/sql/xdocs index.xml
jstrachan 2002/09/13 02:44:53
Modified: sql/xdocs index.xml
Log:
Updated the documentation page to describe a bit more accurately what commons-sql is and how to use it.
Revision Changes Path
1.5 +37 -6 jakarta-commons-sandbox/sql/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/sql/xdocs/index.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- index.xml 31 Jul 2002 17:48:36 -0000 1.4
+++ index.xml 13 Sep 2002 09:44:52 -0000 1.5
@@ -13,16 +13,30 @@
<section name="What is Commons SQL?">
<p>
- Commons SQL is a simple set of beans that represent a relational database schema
- such as a Database, Table, Column etc.
+ Commons SQL is a component for working with databases and generating DDL. Its
+ based on experiences and ideas from the Turbine and Torque projects.
+ </p>
+ <p>
+ Commons SQL contains a simple set of
+ <a href="apidocs/org/apache/commons/sql/model/package-summary.html">beans</a>
+ that represent a relational database schema such as a Database, Table, Column etc.
These beans can be read from XML or written to XML using
- <a href="http://jakarta.apache.org/commons/betwixt/">Betwixt</a>.
+ <a href="http://jakarta.apache.org/commons/betwixt/">Betwixt</a> via the
+ <a href="apidocs/org/apache/commons/sql/io/DatabaseReader.html">DatabaseReader</a> and
+ <a href="apidocs/org/apache/commons/sql/io/DatabaseWriter.html">DatabaseWriter</a> classes.
</p>
<p>
There is an example XML document
<a href="http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/sql/src/test-input/datamodel.xml?rev=HEAD">here</a>
</p>
<p>
+ Once you have the relational model, either via beans or XML, you can then create the DDL to create or drop
+ the database for various different phyiscal database.
+ The <a href="apidocs/org/apache/commons/sql/builder/package-summary.html">builder</a>
+ package contains a bunch of classes to generate the DDL for your database.
+ </p>
+
+ <p>
Then the SQL beans can be used by code generation tools like
<a href="http://jakarta.apache.org/velocity/">Velocity</a>
or
@@ -31,13 +45,30 @@
<a href="http://jakarta.apache.org/ojb/">OJB</a>
repository files and so forth.
</p>
+ </section>
+
+ <section name="Using Commons SQL in Ant or Maven">
+ <p>
+ There's also an Ant task to generate the DDL for a physical database. Here's an example of it in use.
+ </p>
+
+<pre>
+ <taskdef
+ name="ddl"
+ classname="org.apache.commons.sql.task.DDLTask">
+ lt;classpath refid="some.classpath"/>
+ </taskdef>
+
+ <ddl
+ xmlFile="src/conf/myschema.xml"
+ targetDatabase="oracle"
+ output="target/myschema-oracle.sql"/>
+</pre>
+
<p>
It is hoped that Commons SQL can be used to create a
<a href="http://jakarta.apache.org/turbine/maven/">Maven</a>
plugin for projects wishing to create beans or OJB files from some logical relational schema.
- </p>
- <p>
- Commons SQL is based on experiences and ideas from the Turbine and Torque projects.
</p>
<!--
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>