Skip to Content
0

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

Apr 14, 2017 at 11:41 AM

153

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Ashwin Dutt R Apr 17, 2017 at 04:31 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Ashwin,

Please find the Navigation details and the cardinality between the entities and the output I am getting for the get expanded entityset.

screenshot1.png

screenshot2.png

screenshot3.png

Please let me know where I am doing wrong.

Thanks

Shaik

screenshot1.png (158.0 kB)
screenshot2.png (73.0 kB)
screenshot3.png (192.4 kB)
0
Karan Shaheri Apr 17, 2017 at 09:25 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
shaik khaleelullah Apr 17, 2017 at 09:52 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Shaik,

Try to display the data in Json format.So the Parent data will be displayed first followed by the child data.

Best Regards,

Rohan

0
Karan Shaheri Apr 17, 2017 at 10:06 AM
0

Hi,

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

Regards,

Karan Shaheri.

Share
10 |10000 characters needed characters left characters exceeded
shaik khaleelullah Apr 17, 2017 at 10:26 AM
0

Hi Karan,

Please find the screen shot of the output display.

Regards

Shaik.screenshot3.png


screenshot3.png (192.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
Karan Shaheri Apr 17, 2017 at 10:40 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
shaik khaleelullah Apr 17, 2017 at 01:40 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded