The annotation @Index is disallowed for this location

后端 未结 3 1802
陌清茗
陌清茗 2020-12-09 15:14

When trying to use the @Index annotation from javax.persistence, Eclipse gives me this error.

I\'m using it right before a java.util.

3条回答
  •  孤城傲影
    2020-12-09 16:07

    See here: https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#annotations-jpa-index

    use this:

    @Table 
    .......,indexes = @Index(columnList = ("COLUMN_NAME"),name="CUSTOM NAME AT INDEX",unique=false)
    ......
    

提交回复
热议问题