cancel
Showing results for 
Search instead for 
Did you mean: 

How to model an m:n relationship in SEGW?

sven_hoffmann
Explorer
0 Kudos

Hello,

I'm wondering how you can model an m:n relationship in SEGW (OData v2).

For example we have an entity-type "project" and a second entity-type "employee". The relationship between these two entities is m:n, since a project typically has some members (employees) and an employee can work in multiple projects.

Could you please give me a hint how to model this?

If one employee could only work (at a time) in one project it woul be clear to me how to model this: The employee-entity would have a property for the project-id and in the referential constraints of the association the id of the principal entity "project" would be mapped to the project-id of the dependent entity "employee".

But for the m:n relationship it is unclear how to do this. If you would like to model an m:n relationship on the database level you usually need a separate table for this. Is there something similar in SEGW?

Thanks in advance and best regards,

Sven.

Accepted Solutions (0)

Answers (1)

Answers (1)

kakshat
Advisor
Advisor
0 Kudos

I googled to find this thread - Many-To-Many Relationships | SCN

sven_hoffmann
Explorer
0 Kudos

Hi Kumar,

before I posted the question I already read the post you found. Unfortunately my question isn't answered in that post.The focus in that thread is more on how to realise this with BOPF. My question is more on how to do this in general. In addition the post you found is also not answered completely.

Thanks,

Sven.

former_member184867
Active Contributor
0 Kudos

How about creating two associations and both with 1:N cardinality ?

Project    ASSOCIATION1   Employee

1                      :                     N

Employee ASSOCIATION2  Project

1                      :                   N

based on that you can design navigation properties

sven_hoffmann
Explorer
0 Kudos

Hello Atanu,

thanks for your answer. What would you suggest for the referential constraints in these two associations?

Regards,

Sven.