Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1105

Expressions in-memory automatic type convertion

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0
    • Undefined future
    • Core Library
    • None

    Description

      The root of the problem is difference in behavior of expressions on server (using queries) and in-memory (using Expression.match(...). All DBMS I know support automatic type convertion, i.e. if I write
      SELECT * FROM a WHERE intProperty='1'
      everything will go OK.

      So, if I write an expression like [note quotes at 1!]
      ExpressionFactory.greaterExp("intProperty", "1")

      it will go normally with a query, but will result in an exception if I try to invoke match(...).
      I suggest to make the behavior similiar and therefore implement automatic type convertion on expressions. I've submitted a patch with a number of tests, which all fail. I think the must all succeed.

      Comments and other expression improvement suggestions are welcomed

      Attachments

        1. patch-test-Expr.txt
          5 kB
          Andrey Razumovsky

        Activity

          People

            andrus Andrus Adamchik
            antidote Andrey Razumovsky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: