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
=========================================