db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Greenlee" <CGreen...@demandsolutions.com>
Subject Precision, scale, and index tablespaces.
Date Wed, 19 Mar 2003 02:36:58 GMT
Hello all,

we've been using Torque for a while to generate SQL based on our OJB
repository.  We've had to tweak a few things to get them to work though,
and we thought we should contribute them back.

1.  When generating DECIMAL columns, we needed to generate precision and
scale.

2.  When generating indexes, we needed (at least on Oracle) to be able to
specify the tablespace for the index.  It's a huge performance boost to
have the index located on a separate drive from the table.

3.  We use non-native auto incrementing heavily, and needed to be able to
turn it off.  Although Table has an Id Method, it wasn't being checked in
the velocity macros.  We needed to enable that.

4.  There were some weird end of file characters in some of the velocity
templates that caused SQL generation to die a horrible death under
Windows.

Attached is a patch that addresses all these issues.  Here's a short list
of the affected files:

src/generator/src/dtd/database.dtd
src/generator/src/java/org/apache/torque/engine/database/model/Column.java
src/generator/src/java/org/apache/torque/engine/database/model/Table.java
src/generator/src/templates/sql/base/mssql/columns.vm
src/generator/src/templates/sql/base/mssql/db.props
src/generator/src/templates/sql/base/oracle/columns.vm
src/generator/src/templates/sql/base/oracle/db.props
src/generator/src/templates/sql/base/oracle/index.vm
src/generator/src/templates/sql/base/oracle/primarykey.vm
src/generator/src/templates/sql/base/oracle/unique.vm
src/generator/src/templates/sql/base/postgresql/columns.vm
src/generator/src/templates/sql/base/postgresql/db.props
src/generator/src/templates/sql/base/postgresql/index.vm
src/generator/src/templates/sql/base/postgresql/table.vm

We've only modified Oracle, PostgreSQL, and MS SQL velocity macros because
those are the only databases we've been hitting.  As we add more, we'll be
glad to submit those changes back as well.

If you have any questions, I'd be glad to answer them.  We're eager to get
the changes into Torque so that we don't have to maintain a separate local
version.

Regards,

Chris Greenlee


Mime
View raw message