Skip to Content
author's profile photo
Former Member

Nested table in hana by using Calc views

I have a requirement to get data in the below format from hana, I have written a Calc view..but I am not sure how get to store the looping data (Awards, Wall of fame) by using Nested table. So that I can get the data in the below format. I am using Java Spring Framework to call the calc view.

Main table have to contain Awards and Wall of fame has nested tables.

{

"Name": "A",

"No": 89700,

"Awards": [

{

"Award_key": 1,

"Award_name": "Best Performer1"

},

{

"Award_key": 2,

"Award_name": "Best Performer2"

},

{

"Award_key": 3,

"Award_name": "Best Performer3"

}

],

"Wall_fame": [

{

"WF_key": 1,

"WF_name": "Best Performer1"

},

{

"WF_key": 2,

"WF_name": "Best Performer2"

}

]

}

Need help.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 10, 2016 at 07:40 AM

    Just by using the calculation view, you will not get the required format. The calculation view just returns a flat/denormalized structure. To get that normalized structure you could use an XSJS service to prepare that JSON response. Another way would be to use an XSOData service with three entities (base entity, awards, wall frame) and the necessary dependency/navigation settings. Doing a GET request on the base entity with an expand on the two dependent entities would give you then the result in a similar form.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the reply ..Florian.

      I was expecting Hana would support Object and table types as Oracle render the same JSON structure with nested Object and table types.