Hey Gavin and all!
Today I found the great feature of Hibernates lazy initializer, that it
doesnt load the object if you read only the id of the object. (the id is
already loaded).
Sadly it didnt work, because it compared the invoked method with the
pk-getter of the class, and not the proxy interface.
To fix it I had to change ClassPersister like this:
Index: cirrus/hibernate/impl/ClassPersister.java
===================================================================
RCS file:
/cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/ClassPersister.java,v
retrieving revision 1.139
diff -r1.139 ClassPersister.java
506c506,510
< getIdentifierMethod = ReflectHelper.getGetterMethod(mappedClass,
identifierPropertyName);
---
> final Class proxyInterface = model.getProxyInterface();
> if (proxyInterface != null)
> getIdentifierMethod = ReflectHelper.getGetterMethod(proxyInterface,
identifierPropertyName);
> else
> getIdentifierMethod = ReflectHelper.getGetterMethod(mappedClass,
identifierPropertyName);
The variable name getIdentifierMethod is a bit misleading now, so maybe you
will want to change the name.
regards,
chris
|