Hello,
I have a hibernate setup with 50+ objects. For some tables I have multiple objects in the same table, hence I use a 'discriminator' to distinguish the objects.
Now, how can I go about adding an index to the discriminator column?
I am using MySQL 5 with InnoDB tables.
I have tried...
@Entity
@Table(name="PersistObject",uniqueConstraints = @UniqueConstraint(columnNames = {"manufacturer", "partNumber"}))
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name="type",
discriminatorType=DiscriminatorType.CHAR,
columnDefinition="CHAR(1) CHARACTER SET utf8 COLLATE utf8_bin"
)
@DiscriminatorValue("4")
@org.hibernate.annotations.Table(appliesTo = "PersistObject", indexes = @org.hibernate.annotations.Index(name = "type_index", columnNames = "type"))
to no avail. I have also tried editing the xml config but with no results.
Your input would be greatly appreciated.
Thanks,
Omid S
_________________ Thanks!, Omid S
|