aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-xorm/xorm/session_get.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-xorm/xorm/session_get.go')
-rw-r--r--vendor/github.com/go-xorm/xorm/session_get.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/go-xorm/xorm/session_get.go b/vendor/github.com/go-xorm/xorm/session_get.go
index 68b37af7f1..3b2c9493c2 100644
--- a/vendor/github.com/go-xorm/xorm/session_get.go
+++ b/vendor/github.com/go-xorm/xorm/session_get.go
@@ -31,7 +31,7 @@ func (session *Session) get(bean interface{}) (bool, error) {
}
if beanValue.Elem().Kind() == reflect.Struct {
- if err := session.statement.setRefValue(beanValue.Elem()); err != nil {
+ if err := session.statement.setRefBean(bean); err != nil {
return false, err
}
}
@@ -57,7 +57,7 @@ func (session *Session) get(bean interface{}) (bool, error) {
table := session.statement.RefTable
if session.canCache() && beanValue.Elem().Kind() == reflect.Struct {
- if cacher := session.engine.getCacher2(table); cacher != nil &&
+ if cacher := session.engine.getCacher(table.Name); cacher != nil &&
!session.statement.unscoped {
has, err := session.cacheGet(bean, sqlStr, args...)
if err != ErrCacheFailed {
@@ -134,8 +134,9 @@ func (session *Session) cacheGet(bean interface{}, sqlStr string, args ...interf
return false, ErrCacheFailed
}
- cacher := session.engine.getCacher2(session.statement.RefTable)
tableName := session.statement.TableName()
+ cacher := session.engine.getCacher(tableName)
+
session.engine.logger.Debug("[cacheGet] find sql:", newsql, args)
table := session.statement.RefTable
ids, err := core.GetCacheSql(cacher, tableName, newsql, args)