我建立了本地商店的数据库。
我有这些实体:
Product(product_id(PK),product_name,..),
Customer(customer_id(PK),customer_name,..)订单或 ProductBasket(order_id(PK),product_id(PK,FK),product_quantity)
CustomerOrders(customerOrders_id,customer_id(FK),order_id(FK))
如何在Hibernate中严格设置PK,bcs是否有属性的复合键,其中之一不是简单类型(产品)?
我是否应该专门为order_id创建另一个实体,该实体将是PK并将替代密钥添加到Order实体?