Hi Experts!
In my organization we've developed a java application that exposes odata services, some technologies that we've used are:
Everything seems to work fine, we can consume the odatas and do our requirements, but I've found a problem when performing a filter by date.
Query:
WorkOrderHeaders?$filter=(StartDate ge datetime'2018-01-16T05:00:00')
Result:
QueryException: unexpected char: '{' [SELECT E1 FROM WorkOrderHeader E1 WHERE (E1.startDate >= {ts '2018-01-16 05:00:00.000'})]

I thought it was a problem of Olingo, so I did a research and found this article: https://issues.apache.org/jira/browse/OLINGO-240?jql=text%20~%20%22datetime%20filter%22
It basically said: "This issue is specific to hibernate and currently there is no specific handling in Olingo JPA processor for hibernate."
Googling about hibernate I've found this: https://hibernate.atlassian.net/browse/HHH-8653
It mention: "The root of the problem seems to be that the Hibernate generated grammar does not include support for temporal literals"
So, apparently hibernate don't provide support for date literals.
ps. I've builded a small project using the same technologies but considering eclipselink instead of hibernate and it works fine with date filters.
Request clarification before answering.
Hi Ivan
Considering that you've made it work with EclipseLink, are there any reasons why you should be using hibernate instead?
BTW: SAP has delivers the library "SDK for Services" which is basically the same "logic" behind the new cloud foundry "application programming model". With both technologies you are able to create your own OData services based on a DB entities with automation and simplification of the development process without sacrificing flexibility. I'd suggest looking into it as well. There os a nice blog on how to create samples using this technologies.
Hope that helps.
Regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.