Skip to Content
0

SAP Gateway (OData) - many-to-many relationship

Sep 06, 2017 at 08:11 AM

339

avatar image
Former Member

Hi, all.

I have two entity types - "Client" and "Manager". They have Many-to-Many relationship In our system. I'm modeling this relationship using additional entity - "ClientManagerLink", what "is not beautiful".

Can i model Many-to-Many relation ship without "excess" Link entity?

How to best practices for modeling Many-to-Many relationship?

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

3 Answers

avatar image
Former Member Sep 07, 2017 at 05:14 AM
0

Hi Sergey Chebotarev,

You can define associations between entities to express relationships between entities:

1.Basically "Associations" define the relationship between two or more Entity Types like for example, Employee WorksFor Department). Its instances are grouped in Association Sets.

2."Navigation Properties" are special properties on Entity Types which are bound to a specific association and can be used to refer to associations of an entity.

PG

Share
10 |10000 characters needed characters left characters exceeded
Ankit Maskara
Sep 07, 2017 at 10:00 AM
0

Hi,

While modelling the gateway project, you need to specify the cardinality of the entities in an association. You have an option to choose the cardinality as either M ( 0..n) or N (1..n) for Principal and Dependent Entity.

BR.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 07, 2017 at 09:27 PM
0

Thanks for your answers

I understand as modeling cardinality one-to-many and many-to-one, but I don't understand modeling cardinality many-to-many.

I follow your recommendation

But Manager, have not property for ClientID (see below)

In my example I need add new entity ManagerClientLink, without this entity I don't may create association.

Can i modeling Many-to-Many relationship without "excess" Link entity?

I read these topics

https://archive.sap.com/discussions/thread/3832655

https://archive.sap.com/discussions/thread/3660427

https://stackoverflow.com/questions/34048581/how-to-model-a-many-to-many-relationship-in-sap-netweaver-gateway

but I do not found answer


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

Hi,

Yeah I think we have other solution to your query ---

Can i modeling Many-to-Many relationship without "excess" Link entity?

Such case I may add one field in each entity type so entity Client and Manager will have a common field--- This Common field will maintain a cardinality as well take care of Principle and dependent Property while creating association.

This might look like below:

As I think having a extra field in Entity type seems feasible than making a diff entity spcially for reference... -- Not recommended.

Hope it help,

Cheers!!

PG

0