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

Chandan V.A commented on OLINGO-451:
------------------------------------

Hi Dhaval,
There is no function in JPQL that directly can be mapped to startswith and 
endswith. Hence they have to be computed using functions like LOCATE.

For example startswith should be computed using the function 
LOCATE(SEARCHSTRING, SEARCHEDSTRING, 1) = 1 and endswith should be computed 
using function LOCATE(SEARCHSTRING, SEARCHEDSTRING, LENGTH(SEARCHSTRING) - 
LENGTH(SEARCHEDSTRING)) = (LENGTH(SEARCHSTRING) - LENGTH(SEARCHEDSTRING))

I believe this should solve the use case.

Regards
Chandan

> Startswith and endswith is not supported by odata2
> --------------------------------------------------
>
>                 Key: OLINGO-451
>                 URL: https://issues.apache.org/jira/browse/OLINGO-451
>             Project: Olingo
>          Issue Type: New Feature
>          Components: odata2-jpa
>            Reporter: dhaval gupta
>            Assignee: Chandan V.A
>            Priority: Minor
>
> Odata2 version is not supporting some functions like startswith , endswith, 
> etc which is supported by the odata protocol. While querying the odata2 
> olingo built service using Linqpad I am getting some exception. I am using 
> odata2 with jpa.



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

Reply via email to