-->
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: How many SQLs are generated in Parent Child relationship
PostPosted: Tue Dec 02, 2003 2:15 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Hi,

If i dont have the parent child relationship for tw0o entities(which are really parent child) but i dont want to associate them, if i would like to load each of the entity by themselves like

session.load(parent,id)
session.load(child,id)

and when i want to save(3 tier - after user inetraction) i might do like this
in a different session--

session.saveorupdate(parent);
session.saveorupdate(child);

-------------------------------------
So what are the pitfalls here if i dont have a relationship and want to load and save each entity on their own, is it like it will create more number of sql queries behind the scene to load or save/update the entities or only the # of lines of code increases since i have to load each one of them and save/update them one by one instead of just having

session.load(parent)---will load everything if i have the relationship
and
session.saveorupdate(parent)

----I wont be able to make use of the lazyloading even when i have set the relationship as the whole object graph need to travel to GUI tier for display purpose and for the user to modify it.


Thanks in advance


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.