Hi everyone,
i have the below setup:
@MappedSuperclass public class BaseEntity { @Index(name = "code") private String code;
@Index(name = "active") private Boolean active;
@Index(name = "valid") private Boolean valid; }
All other entities extend BaseEntity. This works fine on MySQL, as the index name must only be unique per table. On Oracle the index name must be unique per schema, as all indexes end up in the USER_INDEXES table.
Is there a possibility to tell hibernate to add an id to make the index name unique for Oracle? The only solution i found is using the @Tables annotation (see http://stackoverflow.com/questions/18272817/create-index-on-field-from-parent-class). This doesn't seem to work for me, it just ignores the annotation and doesn't create any index. Another problem is that i don't know all inherited entities at compile time as i'm in an OSGi environment.
At the moment i'm using JBoss EAP 6.0 and Hibernate 4.2.7. Upgrading JBoss EAP and Hibernate is not an option at the moment.
Thanks a lot for every hint! Best regards, Marcus
|