首先 说一下ObjectMapper的代码 然而并没哟
核心代码就这几行啦
JavaType javaType = JsonMapper.getInstance().createCollectionType(ArrayList.class, Para.class);
//根据常量和ParaCode获取缓存
Cache cache = new Cache(ParaConstant.*************);
//JsonMapper构建List
result = JsonMapper.getInstance().fromJson(cacheApi.getCache(cache), javaType);
Para.paraCodeValidator(para, validator);
//尝试从缓存中获取数据
result = JsonMapper.getInstance().fromJson(cacheApi.getCache(new Cache(ParaConstant.CACHE_**************+ para.getParaCode())), Para.class);
//如果为空,则去数据库获取数
玩去吧!