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: Initialization of the ManyToOne with NO-PROXY option
PostPosted: Wed Dec 12, 2007 7:27 am 
Newbie

Joined: Thu Jan 13, 2005 4:04 am
Posts: 12
Location: Estonia
Hi,

I have following manyToOne lazy association to the same model object (recurssive inside one class) defined in my domain object (with bytecode instrumentation enabled):

@ManyToOne
@LazyToOne(LazyToOneOption.NO_PROXY)
@JoinColumn(name = "NAME1", referencedColumnName = "NAME2", nullable = true, insertable = false, updatable = false)

Lazy loading works fine but I'm unable to initialize this association through query using FETCH JOIN phrase.

If I construct HQL query with JOIN FETCH phrase on given association object, then I can see from log Hibernate constructing SQL joining both sides. But on the returned object there is CGLIB FieldInterceptorImpl linked to, which assumes, that given association is not initialized yet and any access to this association causes lazy.init. except (because session is closed allready).

Is there any way to initialize that association with HQL fetch join query phrase or is there only way to call Hibernate.initialize that causes one more select to be executed? I would prefer "joining" but could not get it to work as I want.

S.
Ilhan


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.