You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Robert D. Morse" <rm...@mdesignz.com> on 2002/02/05 21:13:14 UTC

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
rmorse@mdesignz.com
PGP Key:  D9C4AA6A
PGP Finger Print:  ED56 DEEA 95CF AC99 C2B0  77D4 7D92 ACCA D9C4 AA6A


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Criteria: Checking for NULL

Posted by "Robert D. Morse" <rm...@mdesignz.com>.
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:turbine_user@knology.net]
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:rmorse@mdesignz.com]
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
rmorse@mdesignz.com
PGP Key:  D9C4AA6A
PGP Finger Print:  ED56 DEEA 95CF AC99 C2B0  77D4 7D92 ACCA D9C4 AA6A


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Criteria: Checking for NULL

Posted by Steve <tu...@knology.net>.
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:rmorse@mdesignz.com]
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
rmorse@mdesignz.com
PGP Key:  D9C4AA6A
PGP Finger Print:  ED56 DEEA 95CF AC99 C2B0  77D4 7D92 ACCA D9C4 AA6A


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>