All,
Why would SchemaExport create both "not null" AND "primary key" constraints on an ID column? It results in two constraints being created in the database when only the PK is necessary (since it is implicitly a not null constraint).
I don't think it will cause any problems but this was brought to my attention by our DBA and I had no explanation. I tried both OracleDialect and Oracle9Dialect.
Ideas?
Hibernate version:
2.1.8
Mapping documents:
Code:
<hibernate-mapping>
<class name="model.Test" table="TEST"
dynamic-update="false" dynamic-insert="false"
select-before-update="false" optimistic-lock="version">
<id name="id" column="ID" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">TEST_SEQ</param>
</generator>
</id>
</class>
</hibernate-mapping>
Name and version of the database you are using:Oracle 8i
The generated SQL (show_sql=true):Code:
create table TEST (
ID number(19,0) not null,
primary key (ID)
);
[/code]