Hello,
In Hibernate documentation I found that: "Currently, the specified value of the unique-key attribute is not used to name the constraint in the generated DDL". But is it possible to name unique constraint?
I like to catch ConstraintViolationException and from it get to know which constraint was violated - is it userId, is it userAlternateLogin or something else. It would be great to now it from exception. As a workaround I catch this exception and then I check if there is userId already used or maybe userAlternateLogin is already used or... But it is inconvenient.
Thanks for any help with this issue.
P.S. I've searched documentation, googled many pages and I did not find the answer.
|