Same problem here!
There is a way to avoid compile time instrumentation??? to get proxies in HQL an criteria??
mrik wrote:
I have some Business Objects that have ManyToOne associations with default fetch type for Hibernate 3 (LAZY).
If I load one of those objects using session.get(..) I get a cglib proxy as expected and thus my ManyToOne's are not loaded until I access them.
The problem is if I load one of those objects using HQL, I get the concrete class, not the proxy and Hibernate is performing necessary query to get my ManyToOne's loaded (that's not what I want). Other associations type are fine (lazy).
Is it a normal behaviour ? Is it possible to get a proxy when using HQL ?
Thanks
Aymeric