bug fixed

This commit is contained in:
Lunny Xiao 2013-10-13 00:19:05 +08:00
parent 8392e2bbfb
commit 78c420c381
1 changed files with 6 additions and 1 deletions

View File

@ -585,7 +585,12 @@ func (session *Session) cacheFind(t reflect.Type, sql string, rowsSlicePtr inter
vs := reflect.Indirect(reflect.ValueOf(beans))
for i := 0; i < vs.Len(); i++ {
bean := vs.Index(i).Addr().Interface()
rv := vs.Index(i)
if rv.Kind() != reflect.Ptr {
rv = rv.Addr()
}
bean := rv.Interface()
//bean := vs.Index(i).Addr().Interface()
temps[idxes[i]] = bean
session.Engine.LogDebug("[xorm:cacheFind] cache bean:", tableName, ides[i], bean)
cacher.PutBean(tableName, ides[i].(int64), bean)