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 Re: Null value and Criteria
Date Tue, 14 Jan 2003 03:30:51 GMT
The message I posted earlier is messed up at the mail archive page.
I don't know what I did. Maybe the death march project I am in has caused me
a severe mental damage.
I apologize for that.
Allow me to re-post the same message in normal fashion:





Torque3.0
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
sort.

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

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

"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,
either.

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

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

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
**/



Mime
View raw message