Skip to content

Instantly share code, notes, and snippets.

@galderz
Forked from maniksurtani/gist:1232012
Created October 27, 2011 17:29

Revisions

  1. galderz revised this gist Oct 27, 2011. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -7,14 +7,14 @@

    class MyDAO {
    @CacheResult(cacheName = "user-cache")
    User getUser(long id){...};
    User getUser(long id) {...};

    @CachePut(cacheName = "user-cache")
    void storeUser(long id, @CacheValue User user){...};
    void storeUser(long id, @CacheValue User user) {...};

    @CacheRemoveEntry(cacheName = "user-cache")
    void removeUser(long id){...};
    void removeUser(long id) {...};

    @CacheRemoveAll(cacheName = "user-cache")
    void removeAllUser(){...};
    void removeAllUser() {...};
    }
  2. galderz revised this gist Oct 27, 2011. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -6,15 +6,15 @@
    import javax.cache.interceptor.CacheRemoveAll;

    class MyDAO {
    @CacheResult(cacheName="user-cache")
    @CacheResult(cacheName = "user-cache")
    User getUser(long id){...};

    @CachePut(cacheName="user-cache")
    @CachePut(cacheName = "user-cache")
    void storeUser(long id, @CacheValue User user){...};

    @CacheRemoveEntry(cacheName="user-cache")
    @CacheRemoveEntry(cacheName = "user-cache")
    void removeUser(long id){...};

    @CacheRemoveAll(cacheName="user-cache")
    @CacheRemoveAll(cacheName = "user-cache")
    void removeAllUser(){...};
    }
  3. @maniksurtani maniksurtani created this gist Sep 21, 2011.
    20 changes: 20 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ...
    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(){...};
    }