Beginner |
|
Joined: Wed Aug 10, 2005 4:22 am Posts: 24
|
Hibernate version: 3.0
Mapping documents:
<hibernate-mapping>
<class name="device" table="device" >
<id name="ıd" column="id" type="int">
<generator class="native"/>
</id>
<property name="surname" column="surname" type="string" access="field"/>
</class>
</hibernate-mapping>
**************************
<hibernate-mapping>
<class name="alarm" table="alarm">
<id name="ıd" column="id" type="int">
<generator class="native"/>
</id>
<property name="name" column="name" type="string" access="field"/>
<many-to-one
name="device"
class="Device"
not-null="true" >
<column name="device"/>
</many-to-one>
</class>
</hibernate-mapping>
My mapping documents ara above. What i want is, when i delete a device object the alarms that associated with it also deleted.
By the mapping documents above i get forign key voilation.
thanx
|
|