db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Emminger <e...@ericemminger.com>
Subject Re: Torque Peer object produces bogus SQL statements
Date Wed, 14 May 2003 18:49:50 GMT
Graham

Graham Leggett wrote:
> Hi all,
> 
> I have the following piece of code:
> 
> criteria.addIn("policytype_id", policytypeIds);

I believe part of your problem is you're using "policytype_id" for the 
column name instead of the corresponding static property in your *Peer 
object.

Try

criteria.addIn(PolicyTypePeer.POLICYTYPE_ID, policytypeIds);

> PolicytypePeer.doSelect(criteria);
> 
> policytypeIds is an array of ints. The following SQL code is generated, 
> which throws a SQLException (ignore the missing SELECT and FROM):
> 
> SELECT policytype.POLICYTYPE_ID, policytype.SERIAL, policytype.NAME, 
> policytype.DESCRIPTION FROM policytype,  WHERE .policytype_id IN (15,16)
> 
> This is major breakage - anyone know what is going on?
> 
> I am using torque v3.0.

Please, tell us which database you're using and include the stack trace 
of the Exception.

Eric


Mime
View raw message