-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: foreign key
PostPosted: Thu Sep 22, 2005 4:32 am 
Beginner
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 4:39 am 
Pro
Pro

Joined: Fri Sep 02, 2005 4:21 am
Posts: 206
Location: Vienna
Take for example a look at http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#objectstate-transitive.

Erik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.