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

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

Hello Riley,
Since many of the methods in java.util.Date were deprecated as of JDK 1.1, it 
was a conscious decision not to support java.util.Date. In fact an error was 
being thrown for those types that are not supported but due to an error in the 
JPA Error callback code this was not displayed.

I have fixed that error display issue with 
http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/418c631c. Now you 
will get proper error for all missing types.
With this I would like to close the ticket. Please free to open the issue in 
case further discussions are needed around supporting java.util.Date.

Thanks
Kind Regards
Chandan

> Unable to POST an entity with a DateTime type field using underlying JPA model
> ------------------------------------------------------------------------------
>
>                 Key: OLINGO-293
>                 URL: https://issues.apache.org/jira/browse/OLINGO-293
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 1.2.0
>         Environment: Tomcat 7.0.45
> Eclipselink 2.5.0
>            Reporter: Riley Rainey
>            Assignee: Chandan V.A
>            Priority: Minor
>             Fix For: V2 2.0.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to