db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bogdan Vatkov" <bvat...@globaltech-bg.com>
Subject Re: torque-gen multiple db ?
Date Fri, 19 Mar 2004 10:52:51 GMT
> I did not knew that I have to have all three properties:
> primaryKey
> autoIncrement
> required

Yep ..these are not native or specific to any database ...they are common
for the DTD that torque defines
So you have to use them in all databases (i use them for postgresql)

> So I had to run some tests until I get it rights (finally). You have the
> same attributes in postgres? Do you have to do some extra tweaks (like
> specifying the name of the generated sequence)? How do you do this in
> torque?

yes i have made some tweaks :
torque 3.1 is designed to support postgresql 7.2.x
and in pgsql 7.2.x you have to explicitly CREATE SEQUENCE ...
and to DROP SEQUENCE when dropping the table
but in pgsql 7.3.x all sequence stuff is automatic ..and you do not have to
explicitly create sequances (SQL statement for them)

so i patched the velocity templates that create SQL statement for postgresql
just removed the sequences sattements and everything is just fine

i made some other fixes also ..in the velocity templates that are
responsible for namingMethod and in all db oriented class files (om)
to support table names with . (dot) in it.
but if you are not going to use schemas (namespaces) in postgreqsl removing
of sequence sql is enough.

btw ..postgresql allows the . (dot) to be located in the name of schema or
table itselft but they should be enclosed in ""
schema_name.table_name (no dots inside names,only for separation of schema
and table)
"my.schema_name"."my.table_name.is.something" (dots inside names)
for these complicate cases you will need more serious torque templates

thanx for the <external-schema once more time Alex ;)


To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message