fix session_find & session_get getCacher param error (#1131)
* fix session_delete getCacher tablename param error * fix session_find & session_get getCacher param error
This commit is contained in:
parent
01dd69d390
commit
b07c406703
|
@ -176,7 +176,7 @@ func (session *Session) find(rowsSlicePtr interface{}, condiBean ...interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
if session.canCache() {
|
if session.canCache() {
|
||||||
if cacher := session.engine.getCacher(table.Name); cacher != nil &&
|
if cacher := session.engine.getCacher(session.statement.TableName()); cacher != nil &&
|
||||||
!session.statement.IsDistinct &&
|
!session.statement.IsDistinct &&
|
||||||
!session.statement.unscoped {
|
!session.statement.unscoped {
|
||||||
err = session.cacheFind(sliceElementType, sqlStr, rowsSlicePtr, args...)
|
err = session.cacheFind(sliceElementType, sqlStr, rowsSlicePtr, args...)
|
||||||
|
|
|
@ -58,7 +58,7 @@ func (session *Session) get(bean interface{}) (bool, error) {
|
||||||
table := session.statement.RefTable
|
table := session.statement.RefTable
|
||||||
|
|
||||||
if session.canCache() && beanValue.Elem().Kind() == reflect.Struct {
|
if session.canCache() && beanValue.Elem().Kind() == reflect.Struct {
|
||||||
if cacher := session.engine.getCacher(table.Name); cacher != nil &&
|
if cacher := session.engine.getCacher(session.statement.TableName()); cacher != nil &&
|
||||||
!session.statement.unscoped {
|
!session.statement.unscoped {
|
||||||
has, err := session.cacheGet(bean, sqlStr, args...)
|
has, err := session.cacheGet(bean, sqlStr, args...)
|
||||||
if err != ErrCacheFailed {
|
if err != ErrCacheFailed {
|
||||||
|
|
Loading…
Reference in New Issue