I want to create a unique column "dtString" I have specified the unique="true" constraint in the hbm file but the generated ddl doesn't contain the unique constraint. What am I doing wrong?
Hibernate version:
version 2.1.4, 02. June 2004
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="com.nokia.sspa.vobjects">
<class name="VObjectOthertypes" table="sspa_othertypes">
<id name="id" column="id" type="string">
<generator class="uuid.hex"/>
</id>
<property name="lastModified" unique="false" not-null="false" column="lastModified" />
<property name="modifierId" unique="false" not-null="false" column="modifierId" />
<property name="otherId" unique="false" not-null="true" type="string">
<column name="otherId" length="128"/>
</property>
<property name="dtShort" unique="false" not-null="true" column="dtShort" />
<property name="dtLong" unique="false" not-null="true" column="dtLong" />
<property name="dtInteger" unique="false" not-null="true" column="dtInteger" />
<property name="dtString" unique="true" not-null="true" type="string">
<column name="dtString" length="128"/>
</property>
<property name="dtBoolean" unique="false" not-null="true" column="dtBoolean" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
postgres (PostgreSQL) 8.0.0beta4
The generated SQL (show_sql=true):
[schemaexport] create table sspa_othertypes (
[schemaexport] id VARCHAR(255) not null,
[schemaexport] lastModified TIMESTAMP,
[schemaexport] modifierId VARCHAR(255),
[schemaexport] otherId VARCHAR(128),
[schemaexport] dtShort INT2 not null,
[schemaexport] dtLong INT8 not null,
[schemaexport] dtInteger INT4 not null,
[schemaexport] dtString VARCHAR(128),
[schemaexport] dtBoolean BOOL not null,
[schemaexport] primary key (id)
[schemaexport] );
Debug level Hibernate log excerpt:
_________________ Mousa
|