[ 
https://issues.apache.org/jira/browse/OLINGO-583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ramesh Reddy resolved OLINGO-583.
---------------------------------
    Resolution: Not A Problem
      Assignee: Ramesh Reddy

You should provide an array property like

{code}
  public static Property createPrimitiveCollection(final String name, final 
Object... values) {
    return new Property(null, name, ValueType.COLLECTION_PRIMITIVE, 
Arrays.asList(values));
  }
{code}

> support primitive type arrays 
> ------------------------------
>
>                 Key: OLINGO-583
>                 URL: https://issues.apache.org/jira/browse/OLINGO-583
>             Project: Olingo
>          Issue Type: New Feature
>          Components: odata4-commons
>    Affects Versions: (Java) V4 4.0.0-beta-02
>            Reporter: Erming Tuo
>            Assignee: Ramesh Reddy
>
> Here is $metadata of the property Serials, which is a collection of primitive 
> –
>  
>         <Property Name="Serials" Type="Collection(Edm.Int32)"/>
>  
> Now, here is how I compose the Property –
>  
>         int[] serials = new int[2];
>         serials[0] = 1342343;
>         serials[1] = 13;
>  
> Property serialProperty = new PropertyImpl(null, “Serials”, 
> ValueType.COLLECTION_PRIMITIVE, serials);
>  
> Very simple and straight , and then library will throw out this mistake –
>  
> 1.  {
> 2.      "error":
> 3.      {
> 4.          "code": null,
> 5.          "message": "[I cannot be cast to java.util.List"
> 6.      }
> 7.  }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to