david wrote:
Should be working fine. Just to make sure I have the correct context can you show a snipt of the schema and the resulting snipit of mapping document.
Here's a small example:
DDL for table
---------------
CREATE TABLE MP (
id INT8 NOT NULL
, referencia TEXT NOT NULL CONSTRAINT mp_ref_unique UNIQUE
, designacao TEXT NOT NULL
, modelo TEXT
, tipo TEXT
, peso DECIMAL(10,2)
, fornecedor_fk INT8 NOT NULL
, data_monitorizacao DATE
, desenho_material TEXT
, norma TEXT
, legislacao TEXT
, fabricante TEXT
, estado CHAR(1)
, estado_monit TEXT
, user_id CHAR(10) NOT NULL
, dt_hr TIMESTAMP(10) NOT NULL
, PRIMARY KEY (id)
);
Mapping file generated by R3
----------------------------------
<!--
Created by Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class
name="pt.comseal.arsol.hibernate.Mp"
table="mp"
>
<id
name="id"
type="long"
column="id"
>
<generator class="increment" />
</id>
<property
name="referencia"
type="java.lang.String"
column="referencia"
not-null="true"
length="-1"
/>
<property
name="designacao"
type="java.lang.String"
column="designacao"
not-null="true"
length="-1"
/>
<property
name="modelo"
type="java.lang.String"
column="modelo"
length="-1"
/>
( - continued - )
As you can see, the column "referencia" is not mapped with unique="true". By the way, what's the name of the property file for Middlegen.