RE: Testing ExpressionFactory for null values

From: Fredrik Liden (flide..ranslate.com)
Date: Wed Apr 06 2005 - 21:53:23 EDT

  • Next message: Bryan Lewis: "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 - 21:52:09 EDT