db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shin Hashitani" <hashit...@quants.co.jp>
Subject Null value and Criteria
Date Mon, 13 Jan 2003 16:32:30 GMT
Windows 2000
Struts 1.1b3
Tomcat 4.1.18
PostgreSQL 7.1.4

I ma having Null value problem.

What I thought first was:
Criteria.add(MagazinePeer.PUBLISHED, Criteria.ISNULL);
would check to see if the value in a particular column is null or not.

Well, this doesn't work. I get "Error near 'NULL'" or runtime error of that

In Criteria how to tutorial at Jakarta website:
criteria.add(MagazinePeer.PUBLISHED, (Object)"PUBLISH IS NULL",

This is what is suggested. So I trid that. Now the copmile doesn't go

"AdminViewMainAction.java": Error #: 304 : method add is ambiguous. method
add(java.lang.String, java.lang.Object, org.apache.torque.util.SqlEnum)
class org.apache.torque.util.Criteria and method add(java.lang.String,
java.lang.String, java.lang.Object) class org.apache.torque.util.Criteria
exists. column 83, Row 12

(**The error message came out in Japanese, so it's my translation)

Removing (Object) casting does let me compile it, but it gives me the
runtime error. SqlEnum is a package scoped object, so I cannot cast that,

But before that,
this must happen all the time if somebody try to set NULL value to Criteria

Why we have Criteria.ISNULL constant to begin with?
Another questionwould be "Is suggested solution in Torque website is

Thank you in advance.

Shin Hashitani

 *                             q  u  a  n  t  s  I n c.
 *                         System Engineer
 *        Shin Hashitani
 *  hashitani@quants.co.jp   webmaster@bgedesign.com
 *                        www.quants.co.jp
 *     4-13 Kioi-cho, Mader Matsuda Bld. 3F
 *     Chiyoda, Tokyo 102-0094, Japan
 *     (phone)+81-3-4333-7440
 *       (fax)+81-3-4333-7441

View raw message