-->
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.  [ 3 posts ] 
Author Message
 Post subject: Cascading saves
PostPosted: Mon Feb 14, 2005 6:13 am 
Newbie

Joined: Wed Jan 05, 2005 5:30 am
Posts: 14
Hello

I have a design where I would like to have cascading saves. The only trouble is that the father is not aware of its childs, but the childs knows of its father.

Example:

A folder, has one father folder and many child folders. Problem is that the child knows of the father not the other way around.

I am wondering if I can implement cascade anyway, so when I save the father. The child is saved as well?


Top
 Profile  
 
 Post subject: My mapping file
PostPosted: Mon Feb 14, 2005 6:19 am 
Newbie

Joined: Wed Jan 05, 2005 5:30 am
Posts: 14
Just posted my mapping file


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="data">

<class name="Folder" table="folder">
<id name="folderID" column="Folder_ID" type="java.lang.Integer" unsaved-value="0" >
<generator class="native"/>
</id>

<property name="folderName" column="Folder_Name" type="java.lang.String" not-null="true" />
<property name="folderCreatedDate" column="Folder_Created_Date" type="java.lang.Long" not-null="true" />

<one-to-one name="project" class="Project" />

<list name="childfolders" table="folder" cascade="all">
<key column="FK_Father_Folder_ID"/>
<index column="list_idx" />
<one-to-many class="data.Folder"/>
</list>


</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 14, 2005 6:31 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Maybe thorugh interceptor, but certainly not in a efficient way.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.