Use AfterLoad instead of AfterSet on Structs (#2628)

* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad
This commit is contained in:
Lunny Xiao 2017-10-02 00:52:35 +08:00 committed by Lauris BH
parent 1ad902d529
commit a8717e5e3a
35 changed files with 334 additions and 315 deletions

View file

@ -87,7 +87,7 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
return true, err
}
scanResults, err := session.row2Slice(rows, fields, len(fields), bean)
scanResults, err := session.row2Slice(rows, fields, bean)
if err != nil {
return false, err
}
@ -95,7 +95,12 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
rows.Close()
dataStruct := rValue(bean)
_, err = session.slice2Bean(scanResults, fields, len(fields), bean, &dataStruct, table)
_, err = session.slice2Bean(scanResults, fields, bean, &dataStruct, table)
if err != nil {
return true, err
}
return true, session.executeProcessors()
case reflect.Slice:
err = rows.ScanSlice(bean)
case reflect.Map: