[
https://issues.apache.org/jira/browse/OLINGO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13965260#comment-13965260
]
Selvaratnam Ruckman Colins commented on OLINGO-240:
---------------------------------------------------
I m using 4.2.7.Final...
hibernate-core-4.2.7.Final.jar
hibernate-entitymanager-4.2.7.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-commons-annotations-4.0.2.Final.jar
olingo-odata2-jpa-processor-api-1.2.0.jar
Call Stack
=======
{"request":{"method":"GET","uri":"http://localhost:8080/unity-odata-service/StockMarketData.svc/?odata-debug=json","protocol":"HTTP/1.1","headers":{"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","accept-encoding":"gzip,deflate,sdch","accept-language":"en-US,en;q=0.8","connection":"keep-alive","host":"localhost:8080","user-agent":"Mozilla/5.0
(Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116
Safari/537.36"}},"response":{"status":{"code":200,"info":"OK"},"headers":{"DataServiceVersion":"1.0","Content-Type":"application/xml;charset=utf-8"},"body":"<?xml
version='1.0' encoding='utf-8'?><service
xml:base=\"http://localhost:8080/unity-odata-service/StockMarketData.svc/\"
xmlns=\"http://www.w3.org/2007/app\"
xmlns:atom=\"http://www.w3.org/2005/Atom\"><workspace><atom:title>Default</atom:title><collection
href=\"EMADatas\"><atom:title>EMADatas</atom:title></collection><collection
href=\"Tests\"><atom:title>Tests</atom:title></collection><collection
href=\"EMAMarketDatas\"><atom:title>EMAMarketDatas</atom:title></collection></workspace></service>"},"server":{"environment":{"localAddr":"127.0.0.1","localName":"Ruckman-PC","localPort":"8080","pathInfo":"/","pathTranslated":"F:\\Program
Files\\apache-tomcat-7.0.42\\webapps\\unity-odata-service\\","remoteAddr":"127.0.0.1","remoteHost":"127.0.0.1","remotePort":"52492","scheme":"http","serverName":"localhost","serverPort":"8080","servletPath":"/StockMarketData.svc"},"runtime":[{"class":"ODataRequestHandler","method":"handle","duration":{"value":6743,"unit":"µs"},"children":[{"class":"UriParserImpl","method":"parse","duration":{"value":30,"unit":"µs"}},{"class":"Dispatcher","method":"dispatch","duration":{"value":6120,"unit":"µs"}}]}]}}
> Filter by datetime is not working
> ---------------------------------
>
> Key: OLINGO-240
> URL: https://issues.apache.org/jira/browse/OLINGO-240
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa, odata4-server
> Affects Versions: V2 1.2.0
> Reporter: Selvaratnam Ruckman Colins
> Assignee: Chandan V.A
> Priority: Blocker
>
> I apply the filter URI for search by datetime as mentioned below,
> /StockMarketData.svc/Tests?$filter=TradingDate eq
> datetime'2009-12-26T21:23:38'
> But it gives me following an error
> =========================
> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
> <code/>
> <message xml:lang="en">
> "OData - JPA Runtime: JPA query syntax is not correct"
> </message>
> </error>
> Also i got more information after download the source code and debug
> through,Please take took at the error message below
> org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException:
> "OData - JPA Runtime: JPA query syntax is not correct"
> java.lang.IllegalArgumentException: org.hibernate.QueryException: unexpected
> char: '{' [SELECT E1 FROM au.com.righttime.unity.odata.service.model.Test E1
> WHERE E1.tradingDate = {ts '2009-12-26 21:23:38.000'}]
> Error occurred at ODataRequestHandler.handle
> odataResponse =
> dispatcher.dispatch(method, uriInfo, request.getBody(),
> request.getContentType(), acceptContentType
> .toContentTypeString());
> I used JPA+HIbernate+MySql to export my JPA model and i used following
> annotation to map the date
> @Temporal(TemporalType.TIMESTAMP)
> private Calendar passwordCreatedDate;
> I tried all scenarios like Date...but does not work at all.
--
This message was sent by Atlassian JIRA
(v6.2#6252)