Hibernate @Index on @Enumerated field doesn't work
- by mlaverd
I am using Hibernate to talk to my DB. I have one field that is an enumeration and it is going to be used in a slow query. So I'd like to index it. I've put the following annotations on the field:
@Column(name="RIGHT_TYPE", unique=false, nullable=false, length=10)
@Enumerated(EnumType.STRING)
@Index(name = "ABC_INDEX")
protected RightType rightType;
However, I don't see any index on that field created.
But I can create one manually if I wish so. Why is that? Is there any way to force Hibernate to make it happen?