-->
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.  [ 4 posts ] 
Author Message
 Post subject: Save an object in an object
PostPosted: Mon Oct 04, 2004 8:13 am 
Newbie

Joined: Wed Sep 15, 2004 9:35 am
Posts: 13
Hi,
I have an Object in which is an other one.
When i add the child to the parent, i have to flushing the child before saving the parent.

How cann I save the child when i save the parent?

hier an example:

Parent pa=new Parent();
pa. add(new Child());
pa.save(); -> here comes the error message

net.sf.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: de

I want the the error massage dont appers and the parent saves automaticly his child.
How can i do this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 8:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please read the "parent and child relationships" chapter of the reference manual


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 9:17 am 
Newbie

Joined: Wed Sep 15, 2004 9:35 am
Posts: 13
I looked in the chapter but I don*t found a solution for my problem. can you help me?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 9:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
http://www.hibernate.org/160.html

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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