FAQ
Expressions in-memory automatic type convertion
-----------------------------------------------

Key: CAY-1105
URL: https://issues.apache.org/cayenne/browse/CAY-1105
Project: Cayenne
Issue Type: Improvement
Components: Cayenne Core Library
Affects Versions: 3.0
Reporter: Andrey Razumovsky
Assignee: Andrus Adamchik
Attachments: patch-test-Expr.txt

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

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

  • Anonymous at Sep 10, 2008 at 1:15 pm
    [ https://issues.apache.org/cayenne/browse/CAY-1105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Andrey Razumovsky updated CAY-1105:
    -----------------------------------

    Attachment: patch-test-Expr.txt
    Expressions in-memory automatic type convertion
    -----------------------------------------------

    Key: CAY-1105
    URL: https://issues.apache.org/cayenne/browse/CAY-1105
    Project: Cayenne
    Issue Type: Improvement
    Components: Cayenne Core Library
    Affects Versions: 3.0
    Reporter: Andrey Razumovsky
    Assignee: Andrus Adamchik
    Attachments: patch-test-Expr.txt


    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
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedSep 10, '08 at 1:14p
activeSep 10, '08 at 1:15p
posts2
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 2 posts

People

Translate

site design / logo © 2021 Grokbase