Define unique constraint names in Hibernate mappings

- Define unique constraint names in Hibernate mappings to avoid problems if the unique constraint name generation change.
- Reuse the code to identify database exceptions after the updated Hibernate version supports unique-key attributes in the Mapping files.