commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject [sql] quick heads up...
Date Tue, 10 Sep 2002 18:05:27 GMT
Here's a quick heads up on the commons-sql component. It started with a few
folks trying to refactor the groovy SQL generation stuff from Torque into a
reusable form so that it can be reused on any project that needs to generate
some SQL DDL, such as OJB.

The current site is here...

The basic idea is there's an XML description of the relational database,
such as this...

This can then be loaded, via the DatabaseReader (which uses Betwixt) in the
* package into a collection of regular beans in the *.sql.model

Then the beans can be processed either with normal Java code or with a
templating tool like Velocity.

The *.sql.builder package contains a number of beans that can be used to
generate the SQL DDL to create and drop tables and constraints for different
database implementations etc. The original Velocity scripts for the DDL
creation for each database configuration were a little hard to maintain and
use IMHO, whereas just using regular java code for this bit seemed to work
out OK. Of course folks can easily plugin Velocity scripts to these beans if
they wish or want to preserve their existing scripts etc.

There's an Ant Task, DDLTask in the *.sql.task package, which uses the beans
above to generate the SQL DDL for different physical databases from a given
XML document describing the schema.

Going foward with some minor refactoring we should be able to generate the
documentation of the database, reverse engineer the logical model of a
database from a given JDBC connection etc. Plus ultimately we could enhance
this simple component to auto-create beans and repository descriptors for
OJB etc.


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message