Hi,
Thank you for the response.
The book-author was supposed to be an example, to help make my point. But I guess that was a bad example. Let me try another one. I have a list of products in a table. Each product has a unique id.
Product_table
product_id Product_name
1
shampoo
2 milk
I have another table.. Event table, where actions such as adding to cart (but not actually buying as in paying) and buying are different events.
event_table
Event_id event_name
1 adding to cart
2 purchase
Then I have a third table, reward points where customers are rewarded points based on simply adding to cart or purchasing a product
reward_points_table
product_id event_id reward_points
1 1 25 points
1 2 30 points
2 1 15 points
2 2 20 points
As you can see each column in the third table can have duplicate values, but combination of two keys product_id and event_id cannot be duplicate....
I want to insert values into this third reward_points table using hibernate, in which case i will have to use composite keys... but so far am not able to get it to work....