Thu 21 Jun 2007
Today, I explained the difference between an entity vs. an association of entities to a colleague of mine. I used Oracle’s JPA tutorial to explain the object model vs. its physical representation in database:

Order Entity contains a collection of Item entities - when this object model is implemented in a database, we might create ITEM and ORDER table to represent Item and Order entity and ORDER_ITEM table to represent the association between these two entities.
Table ORDER_ITEM is an association, not a real Entity. We add or remove Item entity from Order entity. ORDER_ITEM is just a way of representing this association in database.
Leave a Reply
You must be logged in to post a comment.