Quantcast
Channel: SCN : Discussion List - BOPF Application Framework
Viewing all articles
Browse latest Browse all 249

Many-To-Many Relationships

$
0
0

Hi all,

 

We have a scenario where many-to-many relationships between business objects are required. We’d like to use the goodies of BOPF, since our requirements include, e.g., web services to read and update business objects (using OData).

 

Right now we are struggling to model such an n:m relationship. I know, that, on the one hand, business objects are hierarchically structured and therefore only support 1:n relationships. On the other hand, OData supports n:n relationships: Both …/Orders?$expand= Products and …/Products?$expand= Orders are possible if implemented correctly.

 

Is there a way to model an n:m relationship using business objects/BOPF, so that one OData service offering both associations can be generated automatically?

 

The only possibility we see right now includes:

  • Modeling both business objects separately
  • Modeling one “association class” business object to store the associations between those business objects
  • Create an OData service, having two entities representing exactly the business objects
  • Implement the getEntitySet of both entities: For expand use the “association class” business object to find all related business objects of the other entity

This looks like an unnecessary effort since all this could be generated, right?

 

In comparison, JPA has a @manyToMany-association, which automatically creates the association class and table. Is something similar possible using business objects/BOPF?

 

Thanks,

Svenja


Viewing all articles
Browse latest Browse all 249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>