Why is hibernate returning a proxy object?
Posted
by predhme
on Stack Overflow
See other posts from Stack Overflow
or by predhme
Published on 2010-04-07T18:12:50Z
Indexed on
2010/04/07
18:13 UTC
Read the original article
Hit count: 209
I have a service method that returns an object from the database. This method is called from numerous parts of the system. However, one particular method is getting a return type of ObjectClass_$$_javassist_somenumber as the type. Which is throwing things off. I call the service method exactly the same as everywhere else, so why would hibernate return the proxy as opposed to the natural object?
I know there are ways to expose the "proxied" object, but I don't feel like I should have to do that.
The query is simply
hibernateTemplate.find("from User u where u.username = ?", username)
© Stack Overflow or respective owner