title: How to use Hibernate @Index annotation properly?
body: <p>i have a java class used as an entity that has 2 classes that inherit from it. this class has some indices but these indices didn't appear in the database. this is my java super class code</p>
  
  <pre><code>import java.io.Serializable;
  import java.util.List;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.Table;
  import javax.persistence.UniqueConstraint;
  import javax.persistence.Version;
  import javax.persistence.OneToMany;
  import org.hibernate.annotations.GenericGenerator;
  
  @Entity
  @Table(name="service", uniqueConstraints = {@UniqueConstraint(columnNames={"name"})})
  @org.hibernate.annotations.Table(appliesTo = "service", 
                                   indexes = { @Index(name = "service_name", columnNames = { "name" }), 
                                   @Index(name = "service_description", columnNames = { "description" }),
                                   @Index(name = "service_accessNumber", columnNames = { "access_number" })   
                       })
  public class Service implements Serializable {
  
  @Column(name="access_number",length = 95,nullable=false)
      String accessNumber;
  
  @Column(length=80,nullable=false)
      String name;
  
  @Column(length=140)
      String description;
  
  }
  </code></pre>
  
  <p>does any one know what is my problem
  Note: i have this problem in my all java classes but this is one of them. the code in all class is the same of this</p>
  
  <p><b>Edit</b>: i build an xml file and put it in a grails project, and when i run this project, database created</p>