JPA equivalent to Hibernate's @NaturalId

后端 未结 2 373
梦如初夏
梦如初夏 2020-12-31 10:38

In Hibernate I can create a unique key using @NaturalId on several properties of the entity.

Is there a JPA equivalent annotation, something that is a p

2条回答
  •  星月不相逢
    2020-12-31 11:16

    No, there is not. You will have to use composite keys, so either EmbeddedId or IdClass depending what you prefer.

提交回复
热议问题