Aurelien DROUARD commented on Improvement HHH-8217

In both "Developer Guide" and "Core Reference Manual" I can read that "the specified value of the unique-key attribute does not name the constraint in the generated DDL".
It was true in Hibernate 3 but it seems to be false in Hibernate 4.

Tried with Hibernate 4.2.2.Final :
ShememaExport generates a DDL with unique-key attribute as unique constraint name.
alter table MY_TABLE add constraint theUniqueKeyAttributeValue unique (COL_1, COL_2);
It's problematic if the unique-key attribute value is not unique in the mapping, or is too long.
Can we go back to a generated unique constraint name (with some config) ?

http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html_single/#d5e347
1.4.1. Customizing the mapping files
The unique-key attribute groups columns in a single, unique key constraint. Currently, the specified value of the unique-key attribute does not name the constraint in the generated DDL. It only groups the columns in the mapping file.

http://docs.jboss.org/hibernate/orm/4.2/manual/en-US/html/ch21.html#toolsetguide-s1-2
21.1.1. Customizing the schema
A unique-key attribute can be used to group columns in a single, unique key constraint. Currently, the specified value of the unique-key attribute is not used to name the constraint in the generated DDL. It is only used to group the columns in the mapping file.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira