After reading the hibnerate docs I added this annotation to my class:
Code:
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"unixGroupName","hostId"})})
It did not generate any new contstraints, but it seems to be working for everyone else so I started debugging.
I found that it is finding and building the UniqueConstraints but it never sends them to the DB.
There is a call in the generateSchemaUpdateScript method of org.hibernate.cfg.Configuration that gets the unique constraints for the table but it is commented out. The only other place is called (that I can find) is in the generateSchemaCreationScript method of the same class but it does not get called since my db dialect (in this case Derby Dilect) supportsUniqueConstraintInCreateAlterTable returns true.
Is there something that I missing to get this working?
Thanks for your time, any help would be greatly appreciated.