是基于mysql的query_cache机制吗? 还是什么,有具体的原理没?
Activity
TommyLemon commentedon Oct 27, 2020
SQLExecutor:

Map<String, List<JSONObject>> cache;
void putCache(String sql, List<JSONObject> list, int type)
List<JSONObject> getCache(String sql, int type)
void removeCache(String sql, int type)
https://github.com/APIJSON/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/SQLExecutor.java
fineday009 commentedon Oct 27, 2020
感谢作者的回答!
简单看了下实现逻辑,是将查到的List缓存起来。这里有个疑问,如果查询的数据表中有更新或者插入,这个缓存其实是感知不到的吧,对于一些需要相对实时但又想缓存部分数据的场景,似乎这个缓存用处不大?
TommyLemon commentedon Oct 30, 2020
这只是单次会话的缓存,用完即清,不需要感知更新。需要全局的可以重写相关方法,用 Redis 等方案存取