You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Carsten Burghardt <ca...@login-solutions.de> on 2003/01/29 12:44:08 UTC

Success with Postgres

That was a hard task!
I got Torque 3.0 going with Postgres sequence-support. It just took me 2 days 
including a lengthy debug-session in Eclipse.

1) The Schema

a) <database defaultIdMethod="autoincrement">
native might also work but the db-adapter registers autoincrement

b) if Torque generated the schema, delete all default entries from sequences, 
otherwise the classes won't compile (something like "default= 
&quot;nextval('table_id_seq'::text)&quot;")

c) For each table that uses sequences add an entry
<id-method-parameter value="table_field_seq"/>

2) Torque.properties

The default entry looks like this

torque.database.default=bookstore
torque.database.callaproject.adapter=postgresql

Unfortunately Torque tries to look up the db-adapter from a "default" entry 
and therefore doesn't find DBPostgres but DBNone (yet another bug...)
No problem: add
torque.database.default.adapter=postgresql

-- 
Dipl. Inf. Carsten Burghardt
Login & Solutions AG
email: carsten.burghardt@login-solutions.de
Tel: 0821/2488-311     Fax: 0821/2488-180