You can use the @Index annotation with EJB3 in Hibernate 3.2.X to create indexes automatically when an entity is deployed.
This annotation can be put either on the Table annotation or directly on the entity property.

Examples:

@javax.persistence.Table(name = "items")
@org.hibernate.annotations.Table(appliesTo = "items", indexes = { @Index(name = "INDX", columnNames = { "idItem" }) })

 

@Index(name = "IDX", columnNames = { "idItem" })
public String getIdItem() {
return timestamp;
}

 

 

0
0
0
s2smodern