| There are a few places where Hibernate does in fact take collected metadata and eliminates duplicates. This seems like a logical candidate because it makes no sense to apply 2 constraints here and such a case might not be supported across all dialects. It likely picks whichever was registered first so long as the columns involved match. But I'd need to look specifically at the code to verify this, but seems reasonable. The most logical choice seems that if a @Column specifies unique=true and there is already a @UniqueConstraint defined for the same column name on the @Table annotation, we skip the unique=true constraint generation and let the table's take precedence. |