# Cache4Result
**Repository Path**: pans/Cache4Result
## Basic Information
- **Project Name**: Cache4Result
- **Description**: Cache4Result 是为返回值做缓存的小工具
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 4
- **Created**: 2014-07-14
- **Last Updated**: 2021-06-20
## Categories & Tags
**Categories**: cache-modules
**Tags**: None
## README
Cache4Result 是为返回值做缓存的小工具
========================================
使用方法:
---------------------------------------
spring config
---------------------------------------
### ehcache.xml
###
@Cache4Result 注解使用
------------------------------------------
###
public class UserServiceImpl implements UserService {
...
/**
* cacheKeyName cache的key的名称
* liveSecond 缓存的存活时间 0 或不写表示 默认ehcache.xml 中的配置
*
* @param department
* @result list
*/
@Cache4Result(cacheKeyName = "findUsersByDepartment_${department.id}_${department.name}" , liveSecond = 60*60 )
public List findUsersByDepartment(Department department){
...
}
}