db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiannis Maglaras" <Yiannis_Magla...@londonmarketing.com>
Subject Postgres - Problem in selecting on timestamp columns
Date Mon, 23 Feb 2004 10:16:26 GMT
Hi there,
 
I am running the latest version of torque (v.3-1) and using
pg74.1jdbc3.jar as postgres jdbc driver.
I have a table that contains a timestamp field, called send_date. I can
populate this table with new entries, but when it comes to selecting on
this field, 
 
Timestamp ts = new java.sql.Timestamp(System.currentTimeMillis());
...
Criteria crit = new Criteria();
crit.add(MessagesPeer.SEND_DATE, ts, Criteria.LESS_EQUAL);
 
I am getting back java exceptions
 
[starter] java.lang.NullPointerException
  [starter]     at
org.apache.torque.util.SqlExpression.build(SqlExpression.java:283)
  [starter]     at
org.apache.torque.util.Criteria$Criterion.appendTo(Criteria.java:3309)
  [starter]     at
org.apache.torque.util.Criteria$Criterion.toString(Criteria.java:3449)
  [starter]     at
org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1146)
  [starter]     at
org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:984)
  [starter]     at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1391)
  [starter]     at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1368)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelectVillageRecords(Unknown
Source)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelectVillageRecords(Unknown
Source)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelect(Unknown Source)
  [starter]     at net.general.services.Test.main(Unknown Source)
  [starter] rethrown as org.apache.torque.TorqueException
  [starter]     at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:236)
  [starter]     at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1374)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelectVillageRecords(Unknown
Source)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelectVillageRecords(Unknown
Source)
  [starter]     at
net.general.services.BaseMessagesPeer.doSelect(Unknown Source)
  [starter]     at net.general.services.Test.main(Unknown Source)
  [starter] Caused by: java.lang.NullPointerException
  [starter]     at
org.apache.torque.util.SqlExpression.build(SqlExpression.java:283)
  [starter]     at
org.apache.torque.util.Criteria$Criterion.appendTo(Criteria.java:3309)
  [starter]     at
org.apache.torque.util.Criteria$Criterion.toString(Criteria.java:3449)
  [starter]     at
org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1146)
  [starter]     at
org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:984)
  [starter]     at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1391)
  [starter]     at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1368)
  [starter]     ... 4 more

Is anyone aware of this issue? Thank you in advance
Yiannis
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message