-->
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.  [ 1 post ] 
Author Message
 Post subject: Forcing hibernate to insert a new row on save
PostPosted: Mon Dec 19, 2005 3:55 pm 
Newbie

Joined: Mon Dec 19, 2005 3:31 pm
Posts: 3
Location: Darmstadt, Germany
I have a parent-child relation with cascade="all-delete-orphan" and I want to insert a new database row (for both the parent and all its children), every time the parent is made persistent.

I tried to solve the problem by using session.merge(). This seems to work well, but one of my properties in the parent is a custom user type and everytime I use merge this attribute remains null.

Another approach was to set the ids manually to null but this didn't work either.

What is the best way to achieve my goal? I don't want to use clone for my objects (because a lot of new problems arise).


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

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.