Amine Nebri created OLINGO-1415:
-----------------------------------

             Summary: Question regarding Edm and deserialization
                 Key: OLINGO-1415
                 URL: https://issues.apache.org/jira/browse/OLINGO-1415
             Project: Olingo
          Issue Type: Question
          Components: odata4-client
    Affects Versions: (Java) V4 4.7.0
            Reporter: Amine Nebri


I have just started using olingo to connect to SAP cloud (aka By Design). All 
we do is query data from SAP.

I'm able to retrieve data through the APIs

I have a questionRetrieving the data model takes way too long. It ends up 
retrieving a 5MB XML. It seems this needs to happen every time there is a need 
to retrieve data.

I'm thinking there has to be a better way to do this but I'm not sure. All of 
the queries we have about one single entity
 # Is there a way to only retrieve edm for one entity?
 # Is there a way to retrieve edm only once, store it somewhere and initialize 
edm from the XML. The idea here is we only need to retrieve edm when anything 
changes on the SAP side?

My next question has to to with deserialization once my client receives all the 
data. Based on the sample I saw online (which I'm using) I have to manually 
convert the data types. See below.

I was hoping the purpose of having edm is for olingo to be able to map the 
types without any coking. am I missing something?

 

List<Map<String, Object>> result = []

feed.entries.each
 {
       entry ->

       Map<String, Object> map = new HashMap<String, Object>()

       entry.properties.entrySet().each
      {
            property ->

           if (property.value instanceof Calendar)
          {
               map[property.key] = 
SimpleDateFormat.instance.format(property.value.time)

              return
         }

          map[property.key] = property.value
     }

     result.add(map)

}

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to