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

Serban Petrescu commented on OLINGO-736:
----------------------------------------

[~chrisam] The problem is that Java primitive types (int, double and so on) may 
not be null. So if the user wants to have a null property, he should use the 
corresponding wrapper type (Integer, Double and so on). I am not sure what else 
we can do in case we want to set a primitive property to null apart from 
throwing an exception (how I did it now) or simply ignoring it. Another option 
would be to set the primitive property to a default value (e.g. 0) but I think 
that would be "bad".

> JPAEntity does not update null values
> -------------------------------------
>
>                 Key: OLINGO-736
>                 URL: https://issues.apache.org/jira/browse/OLINGO-736
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.4
>         Environment: Windows 7 64bit, Google Chrome 43.0.2357.134, JDK 
> 1.8.0_51
>            Reporter: Reinhard Fuchs
>            Assignee: Chandan V.A
>            Priority: Minor
>         Attachments: OLINGO_736.patch
>
>
> In "JPAEntity.setProperty" there is an condition regarding null values ("if 
> (entityPropertyValue != null) ". This condition prevents database simple type 
> values being updateted with null value. According the OData Specification in 
> Point 3.3 (http://www.odata.org/documentation/odata-version-2-0/operations/) 
> this should work.
> Please complete this condition with an else:
> else {
>       method.invoke(entity, entityPropertyValue);
>     }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to