Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

[OLINGO-1501] Fix error when OData client receives EdmDateTime or EdmDateTimeOffset values with precision greater than milliseconds#54

Open
nmiguezg wants to merge 1 commit into
apache:masterfrom
nmiguezg:fork
Open

[OLINGO-1501] Fix error when OData client receives EdmDateTime or EdmDateTimeOffset values with precision greater than milliseconds#54
nmiguezg wants to merge 1 commit into
apache:masterfrom
nmiguezg:fork

Conversation

@nmiguezg

@nmiguezg nmiguezg commented Jan 30, 2025

Copy link
Copy Markdown

When the client library reads a query payload in Atom format containing values of type EdmDateTime or EdmDateTimeOffset with a precision greater than milliseconds, it throws an EdmSimpleTimeException, causing the entire query to fail.

According to the OData 2.0 standard specification (OData 2.0 Overview, section 6. Primitive Data Types), literals of type EdmDateTime and EdmDateTimeOffset support up to seven decimal places of precision:

datetime'yyyy-mm-ddThh:mm[:ss[.fffffff]]' NOTE: Spaces are not allowed between datetime and quoted portion. datetime is case-insensitive

datetimeoffset'' dateTimeOffsetLiteral = Defined by the lexical representation for datetime (including timezone offset) at https://www.w3.org/TR/xmlschema-2

So, here it is fixed by changing both date types default type from java.util.Calendar to java.sql.Timestamp (as it's also the default type in the olingo-odata4 library).

@nmiguezg nmiguezg force-pushed the fork branch 3 times, most recently from 065b18c to 8699c8a Compare February 3, 2025 08:47
…DateTimeOffset values with precision greater than milliseconds
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant