Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1415

Question regarding Edm and deserialization

    XMLWordPrintableJSON

Details

    • Question
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • (Java) V4 4.7.0
    • None
    • odata4-client
    • None

    Description

      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

      1. Is there a way to only retrieve edm for one entity?
      2. 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)

      }

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mino08 Amine Nebri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: