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: Update of a persistent object with a transient object
PostPosted: Mon Dec 20, 2004 1:31 pm 
Newbie

Joined: Mon Dec 20, 2004 1:10 pm
Posts: 1
Dear Hibernate community members,

I am new to the hibernate community and I have an important question. I want to update a persistent object with a transient object.

I have saved in a DB with hyperjaxb and hibernate from Xml file an object A1 with its attributs a1, a2; other attributes a3, a4 and link to object B1 are not filled.
Now I have in my DB an persistent object A1.

Then I have loaded a new Xml file descriping the update of A1, a1, a3, a4 and the link to an object B. With jaxb, I get a new transient object A2 .

If I store it directly in the DB with Hibernate it creates me a new object A2 with a new id. How can I say to hibernate that it have to be compared with the previous object A1 ( for example thy share the same attribute a1. I want Hibernate make a automatic merge / fusion between my two objects for each attributs and foreach relation/association ?

At this end, I want to have:
- A1: a1, a2, a3, a4 link to B
- B : link to A1

and not:
-A1: a1, a2
-A2: a1, a3, a4 link to B
-B: link to A2

After solving this problem, is there a way to automaticaly update a persistent graph objects with a transient graph objects?

If I was not cleared, tell me , I am french.
Thanks you for your help.

Francois, from France


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.