We are using Hibernate annotations and hbm2ddl to generate our database schema. We need to control the constraint names of all foreign keys and primary keys (rather than the random names generated by the tool).
Foreign keys are no problem, as in the example below. However it is not clear how to provide a name for a primary key constraint name (not the column name). Note we want a genuine primary key, not just a unique index.
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "GEOMETRY_ID")
@ForeignKey(name = "FK_ANATOMY_GEOMETRY")
public Geometry getGeometry() {
return geometry;
}
|