I’m plan to upgrade the spring from 4 to 5 Due to which I need to upgrade mybatis from 2 to 3.5.11
While upgrading mybatis , I’m facing this issue which is something unclear to me.
I’m getting below error-
nested exception is org.apache ibatis:executor ExecutorException:
Nested lazy loaded result property "xyz” for “com.xyz.ApplicationMybatisDaogetbyName” already exists in the result map. The leftmost property of al lazy loaded properties must be unique within a result map.
But I checked in my mybatisDao xml , only once it’s mentioned:
Same thing was working in older version of mybatis.
This issue is occurring on using associations it seems but not sure.
I used association as:
property: xyz , column: column name , select: com.xyz.ApplicationMybatisDaogetbyName
I tried to add the properties of sql session bean -
configuration.setLazyLoadingEnabled(false); configuration.setAggressiveLazyLoading(false); configuration.setReturnInstanceForEmptyRow(true);
But it didn’t worked.
Any lead to avoid this issue would be appreciated