Skip to content

Instantly share code, notes, and snippets.

@galderz
Forked from maniksurtani/gist:1232012
Created October 27, 2011 17:29
Show Gist options
  • Save galderz/1320219 to your computer and use it in GitHub Desktop.
Save galderz/1320219 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