Created
September 21, 2011 13:19
-
-
Save maniksurtani/1232012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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