Skip to content

Instantly share code, notes, and snippets.

@maniksurtani
Created September 21, 2011 13:19
Show Gist options
  • Save maniksurtani/1232012 to your computer and use it in GitHub Desktop.
Save maniksurtani/1232012 to your computer and use it in GitHub Desktop.
...
import javax.cache.interceptor.CacheResult;
import javax.cache.interceptor.CachePut;
import javax.cache.interceptor.CacheValue;
import javax.cache.interceptor.CacheRemoveEntry;
import javax.cache.interceptor.CacheRemoveAll;
class MyDAO {
@CacheResult(cacheName="user-cache")
User getUser(long id){...};
@CachePut(cacheName="user-cache")
void storeUser(long id, @CacheValue User user){...};
@CacheRemoveEntry(cacheName="user-cache")
void removeUser(long id){...};
@CacheRemoveAll(cacheName="user-cache")
void removeAllUser(){...};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment