Skip to Content

Odata Services with Parent and Child relation ship ( Complex type )

Hi Team,

We have a requirement to create an OData Services with complex type . Structure of this type is as follows

Parent structure

Header name- TESTFR

-------- Table of Child Structure

-------- Vehicle Num : 876787

---------LIC Plate : YUII

Header name - TESTSM

-----TABLE of child structure

End of parent structure.

Please let me know if any one has done this type of requirement.

I tried this with GET_EXPAND_ENTITYSET but I am not getting data in desired format.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Apr 17, 2017 at 04:31 AM

    Hello,

    You can model this type with correct navigation and cardinality between the entities.

    But if you want to pass inputs as table then Complex Types cannot be used and is only intended for defining the structures.

    Can you share the current model and details on how entities are defined and associated ?

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 09:25 AM

    Hi,

    You can create one entity for Parent structure and another entity with child structure. Create Association and Navigation from Parent entity to Child entity.

    Once association and navigation are done, implement GET_EXPAND_ENTITYSET method to fetch the data.

    Regards,

    Karan Shaheri.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 09:52 AM

    Hi Karan,

    I already done that in the same manner, but the data is getting displayed in the reverse way.

    Child data is coming above , once child data is completed Parent data is getting displayed.

    I need the data to be displayed in parent and child relation ship manner correctly. I don't know what I am missing.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 10:06 AM

    Hi,

    Where are you checking the data display? Can you provide the screenshot?

    Regards,

    Karan Shaheri.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 10:26 AM

    Hi Karan,

    Please find the screen shot of the output display.

    Regards

    Shaik.screenshot3.png

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 10:40 AM

    Hi,

    This is the expected output of Gateway Client when you use expanded entityset. It will always display Child entries first and Parent entity details will be displayed at the end.

    Regards,

    Karan Shaheri.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2017 at 01:40 PM

    Hi,

    Do we have any other way to display the structure exactly like this below.

    Parent structure

    Header name- TESTFR

    -------- Table of Child Structure

    -------- Vehicle Num : 876787

    ---------LIC Plate : YUII

    Header name - TESTSM

    -----TABLE of child structure

    End of parent structure.

    Regards

    Shaik

    Add comment
    10|10000 characters needed characters exceeded