I have a bean which I map to the database using Hibernate. I\'m using Hibernate Annotations to indicate the mapping I want, and to create the indices. The thoroughly simplif
You could do this using Hibernate's auxiliary objects support, but it cannot be done using annotations :-(.
In your example, it would look something like this (lots of stuff omitted for brevity):
create index sysuuid on persons ( system, `uuid`(8) )
drop index sysuuid
I apologize for the lack of an annotation-based answer :-(. Hopefully this helps.
NOTE: If you do take this approach, be aware that the dialect scope has to match exactly. For example, if your Hibernate configuration says to use MySQL5InnoDBDialect, then you must have this dialect in the element as well. Using MySQLDialect will not work even though it is the super-class of the InnoDB dialect.