Re: Enhancement request (Cayenne TRUE and FALSE expressions )

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue May 11 2004 - 12:30:52 EDT

  • Next message: Andrus Adamchik: "Re: how to create this Expression"

    Hey Nikhil,

    Currently object-to-boolean conversion of expression result is done in
    C-like way (see Expression.match(Object)). All numeric non-zero values
    evaluate to TRUE, zero evaluates to FALSE. Other types of objects are
    TRUE when they are not null. So Expression.fromString("1") would always
    be TRUE.

    Still I agree that it is a good idea to allow "true/false" to be used
    in expressions explicitly. I will open a feature request in JIRA and
    see when this can be added.

    Andrus

    On May 11, 2004, at 11:54 AM, Budhiraja, Nikhil wrote:
    > Can we add some more explicit expression types...
    >
    > TRUE and FALSE .. (expressions which always evaluate to true or false).
    >
    > I know we can do Expression.fromString("1 = 1") ( if theres a better
    > way, please let me know).
    >
    > This is something we use quite a lot and would be good if it belongs in
    > the package.
    >
    > Thanks



    This archive was generated by hypermail 2.0.0 : Tue May 11 2004 - 12:30:45 EDT