Spring Data JPA - create @Composite key for the three tables
I am extending my question from here: Define CompositeKey with three tables using JPA/Hibernate? . In this example, I am looking to create Composite key to create unique combination of PRODUCT_ID, CATEGORY_ID, STOCK_ID. I developed below code, but not sure on how to save the records into DB. Stock.java @Entity public class Stock implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "STOCK_ID", unique = true, nullable = false) private Integer stockId; @Column(name = "STOCK_CODE", unique = true, nullable = false, length