NutzCN Logo
问答 daoCache中,fetchLinks获取缓存后不给对象赋值
发布于 3329天前 作者 invincibleChi 2874 次浏览 复制 上一个帖子 下一个帖子
标签: cache dao

fetchLinks获取缓存后不给对象赋值,
从debug分析,是取到缓存的,但是从缓存中取得的User中没有defaultScence和scences对象。
dao.fetchLinks(user, "^defaultScence|userMeta|scences$");
User表关联
@One(target = Scence.class, field = "defaultScenceId")
private Scence defaultScence;
@Many(target = Scence.class, field = "userId")
private List scences;
@Many(target = UserMeta.class, field = "userId")
private List userMeta;
第一次执行:
2015-11-11 10:20:58 DEBUG [http-8080-5] sql = SELECT * FROM t_scence WHERE userId=?, tables = [t_scence]
2015-11-11 10:20:58 DEBUG [http-8080-5] KEY=362969342:_:_:SELECT * FROM t_scence WHERE userId=?:83 SQL=SELECT * FROM t_scence WHERE userId=?
2015-11-11 10:20:58 DEBUG [http-8080-5] cache miss = SELECT * FROM t_scence WHERE userId=?
2015-11-11 10:20:58 DEBUG [http-8080-5] SELECT * FROM t_scence WHERE userId=?
| 1 |
|----|
| 83 |
For example:> "SELECT * FROM t_scence WHERE userId=83"
2015-11-11 10:20:58 DEBUG [http-8080-5] CacheName=t_scence, KEY=362969342:_:_:SELECT * FROM t_scence WHERE userId=?:83
2015-11-11 10:20:58 DEBUG [http-8080-5] sql = SELECT * FROM t_user_meta WHERE userId=?, tables = [t_user_meta]
2015-11-11 10:20:58 DEBUG [http-8080-5] not good for cache >> SELECT * FROM t_user_meta WHERE userId=?
2015-11-11 10:20:58 DEBUG [http-8080-5] SELECT * FROM t_user_meta WHERE userId=?
| 1 |
|----|
| 83 |
For example:> "SELECT * FROM t_user_meta WHERE userId=83"
2015-11-11 10:20:58 DEBUG [http-8080-5] sql = SELECT * FROM t_scence WHERE scenceId=?, tables = [t_scence]
2015-11-11 10:20:58 DEBUG [http-8080-5] KEY=1657627534:_:_:SELECT * FROM t_scence WHERE scenceId=?:83 SQL=SELECT * FROM t_scence WHERE scenceId=?
2015-11-11 10:20:58 DEBUG [http-8080-5] cache miss = SELECT * FROM t_scence WHERE scenceId=?
2015-11-11 10:20:58 DEBUG [http-8080-5] SELECT * FROM t_scence WHERE scenceId=?
| 1 |
|----|
| 83 |
For example:> "SELECT * FROM t_scence WHERE scenceId=83"
2015-11-11 10:20:58 DEBUG [http-8080-5] CacheName=t_scence, KEY=1657627534:_:_:SELECT * FROM t_scence WHERE scenceId=?:83

===========================================
第二次执行:
2015-11-11 10:24:11 DEBUG [http-8080-3] sql = SELECT * FROM t_scence WHERE userId=?, tables = [t_scence]
2015-11-11 10:24:11 DEBUG [http-8080-3] KEY=362969342:_:_:SELECT * FROM t_scence WHERE userId=?:83 SQL=SELECT * FROM t_scence WHERE userId=?
2015-11-11 10:24:11 DEBUG [http-8080-3] cache found key=362969342:_:_:SELECT * FROM t_scence WHERE userId=?:83
2015-11-11 10:24:11 DEBUG [http-8080-3] sql = SELECT * FROM t_user_meta WHERE userId=?, tables = [t_user_meta]
2015-11-11 10:24:11 DEBUG [http-8080-3] not good for cache >> SELECT * FROM t_user_meta WHERE userId=?
2015-11-11 10:24:11 DEBUG [http-8080-3] SELECT * FROM t_user_meta WHERE userId=?
| 1 |
|----|
| 83 |
For example:> "SELECT * FROM t_user_meta WHERE userId=83"
2015-11-11 10:24:11 DEBUG [http-8080-3] sql = SELECT * FROM t_scence WHERE scenceId=?, tables = [t_scence]
2015-11-11 10:24:11 DEBUG [http-8080-3] KEY=1657627534:_:_:SELECT * FROM t_scence WHERE scenceId=?:83 SQL=SELECT * FROM t_scence WHERE scenceId=?
2015-11-11 10:24:11 DEBUG [http-8080-3] cache found key=1657627534:_:_:SELECT * FROM t_scence WHERE scenceId=?:83

=========================================

2 回复

你用的不是1.b.53,有说明的,低于该版本,把NutDao换成NutDaoExt,在dao.js里面

来自炫酷的 NutzCN

添加回复
请先登陆
回到顶部