Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
V2 1.2.0
-
None
-
Tomcat 7.0.45
Eclipselink 2.5.0
Description
Attempting to supply a value for a DateTime field in a POST operation yields this error message:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">"OData - JPA Runtime: JPA create request is not correct"</message>
<innererror>class org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException : "OData - JPA Runtime: Internal error [argument type mismatch]"</innererror>
</error>
I have tried to declare the underlying field a few ways:
@Temporal(TemporalType.TIMESTAMP)
protected Date lastUpdate;
and
@Temporal(TemporalType.TIMESTAMP)
protected Calendar lastUpdate;
The first configuration fails, bit the second (using java.util.Calendar) seems to work.
In the failing case, I have tried POST-ing both as XML and JSON using the proper date format for each.
I can work around this for my specific application, but I expect there will be others that might prefer or need to use Date.