posted 21 years ago
Hi everyone,
NULL is what confuses me. Especially when I deal with them in Torque.
What I thought first was:
Criteria.add(MagazinePeer.PUBLISHED, Criteria.ISNULL);
Well, this doesn't work. I get "Error near 'NULL'" or runtime error of that sort.
In Criteria how to tutorial:
criteria.add(MagazinePeer.PUBLISHED, (Object)"PUBLISH IS NULL", Criteria.CUSTOM);
This is what they suggest. 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.
Do you know how to fix this?
It seems impossible and that can be a huge problem to me.
If you have any idea or suggestion, please let me know. I'd really appreciate it.
Thank you in advance.
/*<br /> * Quants Inc.<br /> * Engineer<br /> *<br /> * Shin Hashitani<br /> * hashitani@quants.co.jp<br /> * <a href="http://www.quants.co.jp" target="_blank" rel="nofollow">www.quants.co.jp</a><br />*/