(hibernate 3.0.5)
Does anyone know under what conditions a 1-M attribute can be dereferenced and lazy-loaded from the database, but then all its attributes are zero and empty because the type is <class>$$EnhancerByCGLIB$2e56093c?
The 1-M collection containing CGLIB proxy elements has all empty and zero business attributes, but all good CGLIB attributes: a real session, a CGLIB$BOUND = true, and a CGLIB$CALLBACK_0 attribute that is encapsulating all of the right values loaded from the database! But they don't hydrate/load/copy into the proxy object itself, so all my object's attributes are null or zero, except for the cglib attributes.
I'm loading an object (A) containing a 1-M collection of (B). I get a (B) from the collection, and (B) has a M-1 of (C). Class (C) has a non-null M-1 attribute of type (D), which is the reference that fails to hydrate.
When I access (C).getD(), it's always null, because the underlying foreign key value is always 0, even though accessing it causes a value of 112 to be loaded from the database.
Accessing (C).get(D) causes the following sequence of events, which looks correct to me:
SessionImpl - initializing proxy: [(D):#112]
BasicEntityPersister - Materializing entity: [(D):#112]
Loader - Loading entity: [(D):#112]
ShortType - binding '112' to parameter: 1
BasicEntityPersister - Hydrating entity: [(D):#112]
DefaultLoadEventListener - Loading entity: [(D):#PT] (what's PT??)
DefaultLoadEventListener - Creating new proxy for entity
TwoPhaseLoad - done materializing entity [(D):#112]
Loader - done entity load
The problem is those values are loaded and stored in the CGLIB$CALLBACK_0 object, but they're not what's returned by the CGLIB proxy, presumably because they're never copied into the attributes of my class, whcih is the <class>$$EnhancerByCGLIB$2e56093c class.
This wouldn't have anything to do with max fetch depth, would it?
Thx,
David