The unique-constraint is actually picked up by the annotation parser. The reason they're actually not pushed to the schema is because when the schema tooling asks the table for the unique-keys, the org.hibernate.mapping.Table#getUniqueKeys() method performs a data sanitize step that is based on the following rules: its just that there is some sanitation logic for unique-key definitions that map to primary-keys. More specifically:
In your specific case, the unique-key qualifies as Rule 2; thus it gets removed. In other words, working as intended. |