Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.0 Beta 9
-
None
-
None
-
windows xp,jdk 1.6.0
Description
org.apache.ibatis.executor.loader.ResultObjectProxy
public Object invoke(Object o, Method method, Object[] args) throws Throwable {
...
if (!Object.class.equals(method.getDeclaringClass()) && PropertyNamer.isGetter(method.getName()))
...
}
while we set lazyloading, the model will be enhanced by cglib, so !Object.class.equals(method.getDeclaringClass()) is always true
then if we call getXXX method, PropertyNamer.isGetter(method.getName()) will return true too
so, ibatis always call lazyLoader.loadAll() if we call getXXX method, even the method is not the lazy loading method which don't use nested sql map
modifed to this will solve the problem
public Object invoke(Object o, Method method, Object[] args) throws Throwable {
...
if (!Object.class.equals(method.getDeclaringClass()) && PropertyNamer.isGetter(method.getName())
&& lazyLoader.hasLoader(method.getName()) )
...
}