-->
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: Reattaching strategies
PostPosted: Wed May 05, 2004 7:38 am 
Newbie

Joined: Thu Jan 29, 2004 3:52 pm
Posts: 16
I've learned yesterday (thanks Gavin) how to completely control the object graph cut transfered to client tier. Clients modify this graph, send it back and automagically everything gets reattached and updated on a server tier.

I cannot help but wonder if ther is a way to somehow place surrogates on certain object reference within an object graph on a client tier and thus tell hibernate that certain parts of the object graph didn't change and save some serialization time as well?

What are the strategies available?

All the best,
Vladimir


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 7:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It is all dependant upon the cascade style. cascade="none" will ignore associated objects.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 10:08 am 
Newbie

Joined: Thu Jan 29, 2004 3:52 pm
Posts: 16
That is correct. However, I think I did not explain my "problem" appropriately enough for you to understand me.

Let me try with a rudimentary example. For example, class A has a many-to-one relationship to B. When A is loaded to client tier, B, from many-to-one relationship, is fetched as well. Client edits A but is not allowed to alter relationship to B. Now when A is to be reattached back to server, in the process of serialization over the wire B gets serialized as well since it is reachable from reference A.

Now, the question. How can I avoid serialization of B and yet retain hibernate in belief that A's many-to-one relationship to B did not change.

In your previous answer, did you mean to say that when I set cascade="none" for A's many-to-one relationship to B , I can simply set a reference to B in A to null and serialize back to server? Or something else?

Hope I am making more sense this time.

All the best,
Vladimir


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.