I've tried that too, sorry I didn't mention that in my original post.  Same
problem, but you also need to cast the Criteria.CUSTOM.

-----Original Message-----
From: Steve [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 8:04 PM
To: Turbine Users List
Subject: RE: Criteria: Checking for NULL


Okay, I dunno why you're getting the missing parenthesis error, but I do see
a possible problem with your criteria.  Normally when using a criteria, you
use the static accessors in the Peer classes (see example below) to return
the fully qualified column name i.e. table_name.column_name.

The example at
http://jakarta.apache.org/turbine/turbine-2/howto/criteria-howto.html uses
the Custom criteria with the following example.

criteria.add(InvoicePeer.DESCRIPTION, (Object)"DESCRIPTION is NULL",
Criteria.CUSTOM);

Note that the first parm uses the InvoicePeer accessor for the description
column, which should return the column fully qualified i.e.
"INVOICE.DESCRIPTION" and the second parm just uses the column name.

Maybe this will help,
Steve


-----Original Message-----
From: Robert D. Morse [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 2:13 PM
To: Turbine Users List
Subject: Criteria: Checking for NULL


I'm trying to select all rows from a table where a particular column IS
NULL.
If I include the following:

criteria.add((String)column_name, (String)column_name + " IS NULL",
(Object)Criteria.CUSTOM);

I get:
java.lang.reflect.InvocationTargetException:  java.sql.EQLException:
ORA-00907: missing right parenthesis


The explicit cast is necessary, otherwise the compiler can't resolve
between:
criteria.add(String, String, Object)
or
criteria.add(String, Object, SqlEnum)

Any suggestions?


-------------------------------------------
Robert D. Morse
[EMAIL PROTECTED]
PGP Key:  D9C4AA6A
PGP Finger Print:  ED56 DEEA 95CF AC99 C2B0  77D4 7D92 ACCA D9C4 AA6A


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to