I have this escenario... I have three 4 entities {orderItem, suppliers, supplier, prices}, and they are related like:
OrderItem 1->* suppliers (some one item can have many supplier prices)
Suppliers 1->1 supplier
Suppliers 1->1 itemPrices
and it's properties
OrderItem {orderId, partId, quantity, suppliers}
Suppliers {orderId, partId, Supplier}
And there my proble goes...
What would be the best way to embed the Suppliers entity to the OrderItem Entity, please forget about the relation between suppliers with supplier and itemprice this is already done using join columns.
Will something like
@JoinTable(name = "Suppliers", joinColumns = { @JoinColumn(name = "orderid", referencedColumnName = "orderid") }, inverseJoinColumns = { @JoinColumn(name = "partid", referencedColumnName = "partid") })
will work?
or:
@OneToMany(mappedBy="orderid, partid")
private List<Suppliers> suppliers;
for example..