I have a ManyToMany relationship between two classes, for example class Customer and class Item. A customer can buy several items, and a product can be purchased by different customers. I need to store additional information in this relationship, for example, on the day the item was purchased. I wonder how this is usually modeled in JPA, because I'm not sure how to express this in code. Should I create a new class to model all the attributes of a relationship and create manyToMany relationships between other classes or is this the best way to do this?
thank
source
share