Metrics
0
Watch 51 Star 82 Fork 19

WhiteBlue / EasyCacheJava

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
ehcache的极简封装,基于注解形式的缓存框架,使用简单 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

#EasyCache

致力于让缓存使用变得简单轻松(误..)

依赖:ehcache.jar

使用缓存:


 @UseCache(cacheName = "user")
    public User getUser() {
        return new User();
    }

会根据方法的参数生成key,cache的name自行在配置文件里写

清除缓存:

    //单个
    @ClearCache(cacheName = "users")
    public List getUsers() {
        return new ArrayList();
    }

    //多个
    @ClearCache(cacheName = {"user","users"})
    public void deleteUser() {
    }

取得代理对象:


    UserDao dao = CacheFactory.get(UserDao.class);
    dao.getUser();
    dao.getUsers();
    dao.deleteUser();

以上,之后会缓慢更新(如果有想法的话)

Comments ( 0 )

You need to Sign in for post a comment

Help Search