-->
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.  [ 4 posts ] 
Author Message
 Post subject: CGLIB proxies & implicit polymorphism
PostPosted: Wed Apr 06, 2005 1:45 pm 
Newbie

Joined: Wed Apr 06, 2005 1:36 pm
Posts: 2
Please, explain me how CGLIB proxies & implicit polymorphism can live together?

For example, let A be a superclass of B, when i try to load B instance with the help of session.load(A.class, someBInstanceUUID), i would receive just a CGLIB proxy, which one cannot be casted to B.

In my project I had to disable lazy loading for all classes ang joined-classes ;( This my I have no advantages of HIbernate 3.0 vs Hibernate 2.2.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 05, 2006 5:27 pm 
Beginner
Beginner

Joined: Thu Aug 28, 2003 3:09 pm
Posts: 39
Location: Brazil
Hi Den.

You will have to get the target of the proxy.

Have a look here for how to do it.

http://forum.hibernate.org/viewtopic.ph ... rnateproxy


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 3:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use session.get

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 9:15 am 
Beginner
Beginner

Joined: Thu Aug 28, 2003 3:09 pm
Posts: 39
Location: Brazil
Hi Emmanuel.

When I was doing my tests trying to solve this problem, even when I called session.get I still received a proxy. Note that this happened if the proxy was already around in session loaded by some other association.

The only way I could do it to not receive a proxy was to specify the full class as first parameter along the id. In this case Hibernate also logged that it was narrowing the proxy and this would break == operation.

Was I doing something wrong?


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