[jira] Created: (OFBIZ-1121) EntityOperator.BETWEEN generates incorrect SQL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-1121) EntityOperator.BETWEEN generates incorrect SQL

Nicolas Malin (Jira)
EntityOperator.BETWEEN generates incorrect SQL
----------------------------------------------

                 Key: OFBIZ-1121
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1121
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: Release Branch 4.0
         Environment: Any
            Reporter: Cameron Smith


EntityOperator.BETWEEN generates incorrect SQL.  For
instance, if I use something like (Java 1.5):

 List criteria = new LinkedList();
 criteria.add(1.0); criteria.add(10.0);
 new EntityExpr("amount", EntityOperator.BETWEEN,
criteria);

 The EntityExpr, if used in a delegator query, will
generate the following SQL:
 ... BETWEEN (1.0, 10.0)

However this syntax is incorrect in the following
RDBMS:
MySQL 5.0:
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html
PostgreSQL 8.2:
http://www.postgresql.org/docs/8.2/static/functions-comparison.html
Oracle 9i: (couldn't be bothered to fight my way
through Oracle's online docs but I did check my ref.
book here and my own recollection of 8 years
programming with Oracle).

I originally put this problem to the ML and no-one had actually used EntityOperator.BETWEEN successfully, they had all used workarounds.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1121) EntityOperator.BETWEEN generates incorrect SQL

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacopo Cappellato closed OFBIZ-1121.
------------------------------------

    Resolution: Duplicate

Please refer to OFBIZ-1045

> EntityOperator.BETWEEN generates incorrect SQL
> ----------------------------------------------
>
>                 Key: OFBIZ-1121
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1121
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 4.0
>         Environment: Any
>            Reporter: Cameron Smith
>
> EntityOperator.BETWEEN generates incorrect SQL.  For
> instance, if I use something like (Java 1.5):
>  List criteria = new LinkedList();
>  criteria.add(1.0); criteria.add(10.0);
>  new EntityExpr("amount", EntityOperator.BETWEEN,
> criteria);
>  The EntityExpr, if used in a delegator query, will
> generate the following SQL:
>  ... BETWEEN (1.0, 10.0)
> However this syntax is incorrect in the following
> RDBMS:
> MySQL 5.0:
> http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html
> PostgreSQL 8.2:
> http://www.postgresql.org/docs/8.2/static/functions-comparison.html
> Oracle 9i: (couldn't be bothered to fight my way
> through Oracle's online docs but I did check my ref.
> book here and my own recollection of 8 years
> programming with Oracle).
> I originally put this problem to the ML and no-one had actually used EntityOperator.BETWEEN successfully, they had all used workarounds.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1121) EntityOperator.BETWEEN generates incorrect SQL

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631643#action_12631643 ]

Luke Prentice commented on OFBIZ-1121:
--------------------------------------

please see patch supplied on OFBIZ-1045. can someone integrate this please?

> EntityOperator.BETWEEN generates incorrect SQL
> ----------------------------------------------
>
>                 Key: OFBIZ-1121
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1121
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 4.0
>         Environment: Any
>            Reporter: Cameron Smith
>
> EntityOperator.BETWEEN generates incorrect SQL.  For
> instance, if I use something like (Java 1.5):
>  List criteria = new LinkedList();
>  criteria.add(1.0); criteria.add(10.0);
>  new EntityExpr("amount", EntityOperator.BETWEEN,
> criteria);
>  The EntityExpr, if used in a delegator query, will
> generate the following SQL:
>  ... BETWEEN (1.0, 10.0)
> However this syntax is incorrect in the following
> RDBMS:
> MySQL 5.0:
> http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html
> PostgreSQL 8.2:
> http://www.postgresql.org/docs/8.2/static/functions-comparison.html
> Oracle 9i: (couldn't be bothered to fight my way
> through Oracle's online docs but I did check my ref.
> book here and my own recollection of 8 years
> programming with Oracle).
> I originally put this problem to the ML and no-one had actually used EntityOperator.BETWEEN successfully, they had all used workarounds.

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