Alright, we discussed this a bit on #hibernate-dev today. I'm rejecting this specific ticket, but following up with a new one. In 5.0, we'll be improving how all constraints/indices are created. As we're discovering, we need a better ruleset to determine outcomings outcomes using all the variations of unique vs. not unique, @Index vs. no @Index, etc. That's also based on whether or not the specific DB automatically creates an index for a constraint.
For ORM 4 on postgres, I'd recommend removing the @Index and instead using an explicitly named unique constraint. Postgres automatically creates a unique index for each unique constraint. See http://www.postgresql.org/docs/8.0/static/indexes-unique.html
|