-->
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.  [ 2 posts ] 
Author Message
 Post subject: Persisting root objects only
PostPosted: Fri Apr 25, 2008 3:12 pm 
Newbie

Joined: Fri Apr 25, 2008 3:02 pm
Posts: 2
Hi, I'm using Spring + Hibernate with annotations in an application based arround a root object with several collections which in turn have several collections. I was wondering how wrong it would be to call save and update methods only on the root object whenever i need a change to be persisted.
For example:
My root object is called Petition and it has a collection of Task elements wich has a collection of Assignment objects. Should i add assignments to a taks, would there be much of a difference if instead specifically saving the changes to that task i called a method which persists changes in the entire Petition object?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 10:50 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

always persisting your root object is possible. Especially if you for example always access your Assignments and Tasks by first retrieving an Petition. There might be a little overhead involved when always persisting root object compared to a single task. Depending on your application that might be of importance or not.
The right approach really depends heavily on your overall requirements and architecture.

--Hardy


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