-->
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: how to re-attach a session to a given collection?
PostPosted: Thu Sep 22, 2005 4:33 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
Hibernate-docs says:

<quote>You may also attach a previously loaded object to a new Session with merge() or lock() before accessing uninitialized collections (or other proxies). </quote>

Q: this works for pojo's themself, but is it also possible to reattach a (proxied) collection to a new session?

Explanation:
I have a pojo Person with numerous one2many-relations.
When I says fritz.getAddresses() I want to lazy-load the addresses ONLY, not any other related collection.


Hibernate version: 3.0.5


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 4:42 am 
Pro
Pro

Joined: Fri Sep 02, 2005 4:21 am
Posts: 206
Location: Vienna
Take a look at http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#objectstate-transitive.
It handles such issues...

Erik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 8:30 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
ErikFK wrote:


there is some good info regarding cascade-issues.
But my problem is quite concrete:

how do I register a new session with a hibernate-collection-proxy?

for entities/POJOs: session.merge(pojo)

for persistent-collection: ???


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.