db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Criteria casting.
Date Tue, 13 Oct 2009 05:26:19 GMT
What you can try to do is to use a postgresql function (if it exists) to
convert the String to integer in the select statement. This should be
accepted by Torque.

     Thomas

Sheldon Ross <sross@simmgene.com> schrieb am 13.10.2009 00:23:42:

> Von:
>
> Sheldon Ross <sross@simmgene.com>
>
> An:
>
> Apache Torque Users List <torque-user@db.apache.org>
>
> Datum:
>
> 13.10.2009 00:28
>
> Betreff:
>
> Criteria casting.
>
> So I have
>
> Criteria subquery = new Criteria();
> criteria.add(ThisObjectPeer.COLUMN_A,valueA);
> criteria.addSelectColumn(ThisObjectPeer.COLUMN_B);
>
> Criteria criteria = new Criteria();
> criteria.add(TheOtherObjectPeer.COLUMN_C,subquery,Criteria.IN);
>
>
> The only problem is COLUMN_B is an string, and COLUMN_C is an integer.
> Is there any way to add a cast in the subquery, or select column as an
> integer?
>
> The new versions of Postgresql strongly enforce types and won't let you
> compare integer to character varying.
>
> Any thoughts?
> Thanks
>
> --
> Sheldon Ross
> Software Development
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Mime
View raw message