How to define index by several columns in hibernate entity?

前端 未结 3 1285
梦谈多话
梦谈多话 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 have to have hibernate.hbm2ddl.auto set to create in persistence.xml. When set to update hibernate won't create indexes.

    hibernate.hbm2ddl.auto = create

提交回复
热议问题