Hi. I'm using Oracle10g dialect and I need to create named unique constraints but it doesn't work.
I'm annotating my pojos this way:
Code:
@UniqueConstraint(name="uc_name", columnNames={"column"})
and getting the following ddl:
Code:
create table mytable (column varchar(10 char) unique);
What I really want is:
Code:
create table mytable (column varchar(10 char));
alter table mytable add constraint uc_name unique(column);
I could create unique indexes too, but the @Index annotation doesn't have any properties to indicate it's unique, so I have to stick to the @UniqueConstraint.
Although @UniqueConstraint has a "name" property, it's ignored when generating ddl. So what's the point of this property? I tried several other dialects and none of them uses the "name" property.
Am I missing something or hibernate really doesn't do that?