I have the following classe:
Depending on whether unique=true is set in getLogin's @Column, I have the following result in the generated statement :
1. getLogin with unique = true:
2. getLogin with unique = false
While the javadoc for unique explains that it is a shortcut for the UniqueConstraint annotation I would rather have Hibernate to:
1. Either fails (eg: you can't mix UniqueConstraint with unique=true)
2. Either use the name from UniqueConstraint
In the example here, Hibernate somehow determined that my UniqueConstraints correspond to something already existing (otherwise I would have two constraints, UK_6iua9a9q6jbsdakwv83vo40rm and uk_usr_login).