From: Gavin K. <ga...@ap...> - 2002-09-13 18:21:11
|
Thanks Christoph! ----- Original Message ----- From: "Christoph Sturm" <ch...@mc...> To: <hib...@li...> Sent: Friday, September 13, 2002 11:56 PM Subject: [Hibernate] fix for bug in lazy initializer > 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 > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |