Zandra Norman commented on Bug HHH-7862

Hi again,

Yes I think that you have misinterpreted the meaning of @OneToMany. In a one-to-many mapping from Customer to Order one Customer can have many Orders, but an Order can only be mapped to one Customer. This means that different Customers should not be able to map to the same order in a one-to-many relationship so the order_id should have a unique constraint. If you want to make that possible you need to use the @ManyToMany annotation.

The @ElementCollection is used to map to “non-entities” which I do not think is what you are looking for, and it still is a one-to-many relationship.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira