1 Reply Latest reply on Jan 13, 2006 12:59 AM by Kirill Trofimov

    Inheritance and Index. How?

    Kirill Trofimov Newbie

      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.