The moose likes OO, Patterns, UML and Refactoring and the fly likes Associative Entities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Associative Entities" Watch "Associative Entities" New topic

Associative Entities

Jules Bach
Ranch Hand

Joined: Apr 28, 2008
Posts: 71
Can an associative entity be used between 2 entities that have a 1:many relationship? Or do must they only apply between a many:many..

The examples I can see online are about many:many
eg. a Grade entity between a Course and a Student...

I thinking about using an associative entity between what I originally considered as a 1:many relationship

i.e An Order has many Order Items...However, an audit history is required (of items being removed or added from the transaction).

So I want to use another entity to map the relationship between the orders and the ordered items...items could be added and removed several times..

I am sounding reasonable here? Or is this crazy talk?
albert smith

Joined: Sep 19, 2008
Posts: 4
It sound reasonable but why would you need it. Why to create an extra entity when those 2 can keep what you really need?
Jules Bach
Ranch Hand

Joined: Apr 28, 2008
Posts: 71
I was thinking that the 'ownership relationship' was not really property of the item, or the order item. I.e. a distinct ownership entity would be suitable to bridge orders with some order items - even if an order item can belong to at most one order.

I could have an attribute in 'order item' entity along the lines of 'who owns me' - but I didn't know if this was in the spirit of ERD modelling...since ownership is not a property of the 'thing' - it's a type of relationship
I agree. Here's the link:
subject: Associative Entities
jQuery in Action, 3rd edition