Hi Cameron,
yeah, that helps indeed, as I am using MySQL myself.

Am I get you right, you do the following when querying for null using method
isNull of your class that extends Criteria:

SimpleCriteria sc = new SimpleCriteria();
sc.add(add something using Citeria-methods);
sc.isNull("MyPeer.FIELD_NAME"); // quuery this field for null-entries
MyPeer.doSelect(c);

Does it work that way?
What's the purpose of Criteria.CUSTOM in your method?

Btw, are you also using the JDBC-driver that has recently been released on
the mysql.com web-site? If yes, are you happy with it, or are you having any
trouble using it in conjunction with Turbine (2.2b3/decoupled Torque)?

Regards
Marc

> -----Ursprungliche Nachricht-----
> Von: Riley, Cameron [mailto:CRiley@;ekmail.com]
> Gesendet: Samstag, 26. Oktober 2002 17:48
> An: '[EMAIL PROTECTED] '
> Betreff: RE: problem using Criteria to query null-values
>
>
> Marc,
>
> >What's wrong here?
> >(I want to query the field ROLE_ID for "null"-values.)
>
> The Turbine criteria is based on a hashtable so adding a string "null" or
> java null to the criteria is different to querying for a null database
> record through SQL. This is the method we use to query a MySQL
> database for
> a Null value. MySQL requires "IS NULL" as part of the SQL query;
>
>
> public SimpleCriteria isNull(String columnname)
> {
>     super.add(columnname,
>               (Object)(columnname + " IS NULL"),
>               Criteria.CUSTOM);
>     return this;
> }
>
> We wrapped the call up into a SimpleCriteria object which extends Criteria
> to simplify a lot of the calls for the MySQL database we are using.
>
> Hope that helps.
>
>
>
> Cameron Riley
>
> --
> To unsubscribe, e-mail:
> <mailto:turbine-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:turbine-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:turbine-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@;jakarta.apache.org>

Reply via email to