0 Replies Latest reply on Apr 12, 2006 12:13 AM by Ben Wang

    PojoCache new field level annotations @Transient and @Serial

    Ben Wang Master

      These two annotations have been requested before. Idea is if we do:

      class Pojo
      {
      @Transient
      Object obj1;

      @Serializable
      Object obj2;

      ...
      }

      then during replication/persistency, we will 1) skip obj1, 2) treat obj2 as a Serializable object (so it needs to implement Serializable interface), even it is an "aspectized" Pojo originally.

      Note that I will provide JDK5.0 support only.

      Couple of additional notes:

      1. For @Transient annotation, so there is no contents in the cache store. When a user do a pojo.getObj1(), we will return the value from the in-memory copy. Likewise, for setObject1().

      2. For @Serializable annotation, when a user do a:

      newObj = pojo.getObj2();
      newObj.setName("Me");
      

      The setName call won't get intercepted by cache because of Serializable interface and as a result, the changes won't get replicated unless user is doing pojo.setObj2(newObj) again (typically of regular cache operation.)