| Consider this entity:
@Entity
@Table(
uniqueConstraints = {
@UniqueConstraint(name = "uk_language_name", columnNames = { "name" })
}
)
public class Language {
@Id
@GeneratedValue(strategy = IDENTITY)
public Integer languageId;
@Column(unique = true)
public String name;
}
It contains redundant uniqueness information on the name column, via @UniqueConstraint and @Column(unique = true). The @UniqueConstraint specifies a name. Yet, when generating DDL from this table using SchemaExport, the name is not taken into consideration, but a synthetic name is generated for the unique constraint. |