How to define index by several columns in hibernate entity?

前端 未结 3 1286
梦谈多话
梦谈多话 2020-12-09 21:24

Morning.

I need to add indexing in hibernate entity. As I know it is possible to do using @Index annotation to specify index for separate column but I need an index

3条回答
  •  臣服心动
    2020-12-09 22:22

    You'd better go with a composite primary key.

    This article explains how to do it with JPA annotations. It uses @Embeddable and @EmbeddedId

提交回复
热议问题