Advertise with us

Our eBooks

How to create an Index on your Entity Beans?


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.


@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;



© 2021 All Rights Reserved.

Please publish modules in offcanvas position.