Really?? I use a matchExp with a null value with no problem. For example,
this gets the employees that have no phone:
Expression exp = ExpressionFactory.matchExp("phoneExtension", null);
That generates SQL like:
SELECT t0.* FROM EMPLOYEE t0 WHERE t0.PHONEEXTENSION IS NULL
What SQL do you see in your log?
----- Original Message -----
From: "Fredrik Liden" <flide..ranslate.com>
To: <cayenne-use..bjectstyle.org>
Sent: Wednesday, April 06, 2005 9:53 PM
Subject: RE: Testing ExpressionFactory for null values
Hi Bryan,
Expression notNullExp = ExpressionFactory.noMatchExp("attributeName",
null));
This returns ALL the items in the list. However, I just want to get the
list of objects where the attribute is null. When I tried
Expression notNullExp = ExpressionFactory.MatchExp("attributeName",
null));
I get no hits at all. If anything I can always iterate through the list
and do the if else but I thought it would look prettier with the
filtering. :)
-----Original Message-----
From: Bryan Lewis [mailto:brya..aine.rr.com]
Sent: Wednesday, April 06, 2005 6:39 PM
To: cayenne-use..bjectstyle.org
Subject: Re: Testing ExpressionFactory for null values
If I understand what you're asking, yes. The ExpressionFactory will do
the
right thing if you give it a value of null.
Expression notNullExp =
ExpressionFactory.noMatchExp("attributeName",
null));
----- Original Message -----
From: "Fredrik Liden" <flide..ranslate.com>
To: <cayenne-use..bjectstyle.org>
Sent: Wednesday, April 06, 2005 9:20 PM
Subject: Testing ExpressionFactory for null values
Is it possible to test for null values using the in-memory
ExpressionFactory?
Or is it just bad design to keep default values as null?
Does anyone have any input?
Thanks!
Fredrik
This archive was generated by hypermail 2.0.0 : Wed Apr 06 2005 - 22:32:55 EDT