Issue Type: Bug Bug
Affects Versions: 4.1.10
Assignee: Unassigned
Components: core
Created: 09/Mar/13 2:23 PM
Description:

I have this property mapping:
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="true" type="java.lang.String">
<column not-null="true" unique="true" name="`name`"/>
</property>

Note the unique="true" and the backticked column name. When creating the db schema hibernate executes this sql statement to create the unique constraint, this fails:
alter table `mandatoryfields` add constraint `name`_ unique (`name`)

The reason it fails is that the postfix (_, the underscore) is placed outside of the backticked name. This statement works fine:
alter table `mandatoryfields` add constraint `name_` unique (`name`);

This error seems to have been introduced after hb 4.1.8 (but not sure...) At least it appears going from 3.6 to 4.1.10.

Environment: Linux, Mysql5
Project: Hibernate ORM
Priority: Major Major
Reporter: Martin Taal
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