Hi, I've mapped a table this way:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="pt.global.data.hibernate.models" default-access="field">
<class name="GraEvent" table="GRA_EVENT">
<id name="id" column="ID_SEQ">
<generator class="increment"/>
</id>
<natural-id mutable="false">
<property name="idCalendar" update="false">
<column name="ID_CALENDAR"
unique="true"
length="30"
not-null="true" />
</property>
</natural-id>
<property column="TITLE" not-null="true" name="title" length="100" />
<property column="TYPE" not-null="true" name="type" length="5" />
<property column="STATUS" not-null="true" name="status" length="5" />
</class>
</hibernate-mapping>
But it is allowing me to insert records with the same ID_CALENDAR. Shouldn't the framework throw an exception when I tried to insert a duplicate?
Kind regards,
Carlos Ferreira