-->
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: get() returns proxy ?
PostPosted: Thu Mar 15, 2007 11:02 am 
Regular
Regular

Joined: Thu Oct 19, 2006 12:07 pm
Posts: 75
Hi!

I have this with hibernate 3.2.0.cr2 (inside JBoss 4.0.4GA):
Code:
Mapped m = session.get(Mapped.class,myID);
session.flush();
session.evict(m);
session.flush();
// ...
session.get(m.getClass,m.getID());


This runs once, and then again (the value of myID is the same).
On the second run, the get(Mapped.class,myID) returns an object of type Mapped$$EnhancerByCGLIB$$f6f2dbd7 instead of Mapped, so the line session.get(m.getClass,m.getID()); fails as it will try to load an object of type Mapped$$EnhancerByCGLIB$$f6f2dbd7 , but that has no defined mapping.
I get :
Code:
Caused by: org.hibernate.MappingException: Unknown entity: Mapped$$EnhancerByCGLIB$$f6f2dbd7


Why does it return in the second case this weird object (I guess it is a proxy) instead of a normal object, like in the first iteration (it is basically a loop).
How do I force it return a plain object ?
The book "Hibernate in Action" says in 4.4.1 "Retrieving objects by identifier" it:
get() never returns a proxy.

But in my case it does ???

Regards,
David


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.