[ 
https://issues.apache.org/jira/browse/OLINGO-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15162757#comment-15162757
 ] 

Michael Bolz commented on OLINGO-891:
-------------------------------------

Hi [~jpenninkhof],

Thanks again for the patch.
It is merged with [this 
commit|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=8c0d15219993ad9a34c25723907934d33c1d84ed]
 and [this 
commit|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=2538dcc7eaf5161ae282c08e0596a36a428fe3fb].
Can you please check and close this issue if all is ok for you.

Just one little remark, it is always helpful for a contribution (and for the 
Olingo team) if after a patch all tests still work  ;o)
For more details about contributions and bugfixes you can take a look at [the 
Olingo homepage|http://olingo.apache.org/contribute.html#providing-bugfix-code].

Kind regards, Michael

> Use only two parameters in CONCAT function of JPA Where Expressions
> -------------------------------------------------------------------
>
>                 Key: OLINGO-891
>                 URL: https://issues.apache.org/jira/browse/OLINGO-891
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.6
>            Reporter: Jan Penninkhof
>            Assignee: Michael Bolz
>             Fix For: V2 2.0.7
>
>         Attachments: 
> 0001-OLINGO-891-Use-nested-concat-instead-of-concat-with-.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Substring filters such as the one below:
> {code}
> $filter=(substringof(%27Jan%27,FirstName)
> {code}
> Are translated into JPA where clauses similar to:
> {code}
> Where case when first_name like concat('%', 'Jan', '%') then 1 else 0 end=1 
> {code}
> However, not all database support concat functions with more than 2 
> parameters. The SAP Hana database is one of them:
> !http://i.imgur.com/9SX0AHh.png!
> I would propose to turn the where clause into:
> {code}
> Where case when last_name like concat('%', concat('Jan', '%')) then 1 else 0 
> end=1
> {code}
> to get the clause to run on more database platforms:
> !http://i.imgur.com/9bnR2ZY.png!
> Patch included in the attachments



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to