it's because CacheKey is same between RankItem{user=User{id=2, name='lisi'}, score=500} and RankItem{user=User{id=3, name='wangwu'}, score=500} , because there score is 500 but User is a object which is not writting into CacheKey
so while handle the third resultSet RankItem{user=User{id=3, name='wangwu'}, score=500} is while create a MetaObject which the originalObject is the second result and it directly set User{id=3, name='wangwu'} to second result
in DefaultResultSetHandler#createRowKeyForMappedProperties
resultMappings
should get from current resultMap
(getResultMappingsForRowKey(resultMap)
)
Comment From: Huangxuny1
sorry , It still has some issues. @emacarron and I are try to resolve it ,