I have 3 entity objects, for example: Pet, Cat, Dog.
I use @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS).
Pes is base class for Cat, Dog.
Pet have column "Name" with @Index(name="xxx").
But, when table is create, i recive error:
ERROR 10-01 11:05:39,890 (SchemaExport.java:create:258) -Unsuccessful: create index xxx on Cat (Name)
ERROR 10-01 11:05:39,890 (SchemaExport.java:create:259) -ERROR: relation "xxx" already exists
ERROR 10-01 11:05:39,921 (SchemaExport.java:create:258) -Unsuccessful: create index xxx on Dog (Name)
ERROR 10-01 11:05:39,921 (SchemaExport.java:create:259) -ERROR: relation "xxx" already exists
How i can use index in Inheritance?
Thanx.
Use
@org.hibernate.annotations.Table(name = "TANLE_NAME, indexes = { @Index(name = "idx_name", columnNames = { "name" }) ... })