-->
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.  [ 6 posts ] 
Author Message
 Post subject: Initialization of detached object in a cascade way
PostPosted: Sat Nov 12, 2005 4:31 am 
Newbie

Joined: Sat Oct 01, 2005 3:53 am
Posts: 5
Hi,

As I have seen in all forums, road maps,... there is nothing about having a new feature which allows the inialization of a detached object in a cascade way.

More explanations: in the service layer, I want to work in a lazy mode. Sometimes, I need to pass fully initialized detach objects to my UI layer (all collections of collections have to be initialized).

Is there another way to do it ? Should I post it as a new feature request ?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:21 pm 
Newbie

Joined: Thu Sep 01, 2005 8:43 am
Posts: 14
Oh, I am sure there is a LOT regarding this in the forums (can't recall a conrete one, but I am sure I read something). And normaly the answer is just a short "no" :) I do not think Hibernate will ever be changed in a way to allow auto-open a session in presentation tier just to load the lazy-loaded associations. I wouldn't like the implicitness of such an approach too.
cu,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://hibernate.org/43.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:34 pm 
Newbie

Joined: Thu Sep 01, 2005 8:43 am
Posts: 14
:) That was a quick one! :) Thanks,

jfsublet, Why can't Hibernate just load objects on demand? is maybe of special interest, since you speak about detached objects.

cu,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:40 pm 
Newbie

Joined: Sat Oct 01, 2005 3:53 am
Posts: 5
Sorry, It was not clear enough: I don't want to have an auto-open session in the UI Layer.

In my UI Layer, I would like to work on detached object which are yet fully initialized.

A way to ensure this is to clone my persistent objects in the service layer (or to initialize them using Hibernate.initialize(Object o).

But it means that I could have a lot of database requests :(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:46 pm 
Newbie

Joined: Thu Sep 01, 2005 8:43 am
Posts: 14
Now you lost me - You do not have to have fully initilized objects in the UI layer - you only should have the lazy associations loaded you really need (thus the database requests are inevitable). And you can do this in your service layer or using the open-sesion-in-view pattern while rendering your view.


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