In JPA you can create indexes using annotations, for example as follows:
@Entity(name = "dummyEntity")
@Table( name = "dummyTable",
indexes = {@Index(name = "indexName", columnList = "name")})
public class MyEntityObject {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long id;
private String name;
private String state;
public MyEntitiyObject() {
}
}
How can I add 'state' as an included column to this index, using JPA annotations? Or in another way so I can just roll-out my code without having to add the indexes manually.
Thank you.