feat: 添加查询 Object 相关的方法的缓存示例。

This commit is contained in:
Suomm 2023-08-10 16:45:38 +08:00
parent 3c95f07e6c
commit e5f2c41d04

View File

@ -87,6 +87,30 @@ public class #(table.buildServiceImplClassName()) extends #(serviceImplConfig.bu
return super.getOneAs(query, asType); return super.getOneAs(query, asType);
} }
@Override
@Cacheable(key = "#root.methodName + ':' + #query.toSQL()")
public Object getObj(QueryWrapper query) {
return super.getObj(query);
}
@Override
@Cacheable(key = "#root.methodName + ':' + #query.toSQL()")
public <R> R getObjAs(QueryWrapper query, Class<R> asType) {
return super.getObjAs(query, asType);
}
@Override
@Cacheable(key = "#root.methodName + ':' + #query.toSQL()")
public List<Object> objList(QueryWrapper query) {
return super.objList(query);
}
@Override
@Cacheable(key = "#root.methodName + ':' + #query.toSQL()")
public <R> List<R> objListAs(QueryWrapper query, Class<R> asType) {
return super.objListAs(query, asType);
}
@Override @Override
@Cacheable(key = "#root.methodName + ':' + #query.toSQL()") @Cacheable(key = "#root.methodName + ':' + #query.toSQL()")
public List<#(entityClassName)> list(QueryWrapper query) { public List<#(entityClassName)> list(QueryWrapper query) {