I am using the mySQLDialect, it seems that hibernate doesn't generate the name of the index when using 'unique-key'
unique (firstname, lastname) should be unique FIRSTLASTNAME (firstname, lastname) in my case
Hibernate version:
3.1.2
Mapping documents:
<hibernate-mapping>
<class name="events.Person" table="PERSONS">
<id name="id" column="PERSON_ID">
<generator class="native"/>
</id>
<property name="age"/>
<property name="firstname" unique-key="FIRSTLASTNAME"/>
<property name="lastname" unique-key="FIRSTLASTNAME"/>
</class>
</hibernate-mapping>
Name and version of the database you are using:
mySQL 5.0.17-NT
The generated SQL (show_sql=true):
[java] 19:21:50,444 DEBUG SchemaExport:296 - create table PERSONS (PERSON_ID bigint not null auto_increment, age integer, firstname varchar(255), lastname varchar(255), primary key (PERSON_ID), unique (firstname, lastname)) type=InnoDB
|