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

Luke Prentice commented on OFBIZ-1045:
--------------------------------------

please find a new patch attached which fixes the problem.

there are 2 issues here:
 1. in EntityOperator.java makeRHSWhereStringValue() is not called for "IN" and 
"NOT-LIKE" comparisons because makeRHSWhereStringValue() in 
EntityComparisonOperator.java has 6 parameters, not 5. (it includes 
DatasourceInfo). we have corrected this in EntityOperator.java by giving the 
call to makeRHSWhereStringValue() have an additional parameter.
 2. in EntityOperator.java the "BETWEEN" comparitor had no further 
qualification, so we have written appendRHSBetweenList() to correctly construct 
the SQL.

note: another patch to EntityOperator.java giving "IN"'s call to 
makeRHSWhereStringValue() an additional parameter would mean the correct method 
is called.



> EntityOperator does not correctly construct SQL for BETWEEN clause
> ------------------------------------------------------------------
>
>                 Key: OFBIZ-1045
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1045
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: ubuntu 7.04, postgres 8.2, working with SVN release 
> 4955, but EntityOperator.java has not changed since then.
>            Reporter: Luke Prentice
>            Assignee: Adam Heath
>         Attachments: all-app-framework-EntityOperator.java.diff, 
> all-app-framework-EntityOperator.java.diff, 
> all-app-framework-EntityOperator.java.diff
>
>
> when using the BETWEEN EntityOperator the SQL produced is incorrectly 
> formatted:
> ... field1 BETWEEN (value1, value2)
> it should be
> ... field1 BETWEEN value1 AND value2
> this produces an SQL parse exception.

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

Reply via email to