Annotation Type Cache


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface Cache
    Define the caching configuration of a given MongoDbObject. The options are as follows: timeout: int timout in ms when a cache entry becomes invalid, default -1 means use globalCacheValidTime maxEntries: default -1 means unlimited (Only limited by Memory, uses SoftReferences!) clearOnWrite: clear cache if one element is written strategy: when using fixed number of entries, define how to remove additional entries readCache: use cache for reading writeCache: use cache for writing (schedule write as background job), default false
    Author:
    stephan
    • Element Detail

      • timeout

        int timeout
        Default:
        -1
      • clearOnWrite

        boolean clearOnWrite
        Default:
        true
      • maxEntries

        int maxEntries
        Default:
        -1
      • strategy

        Cache.ClearStrategy strategy
        Default:
        de.caluga.morphium.annotations.caching.Cache.ClearStrategy.FIFO
      • readCache

        boolean readCache
        Default:
        true
      • syncCache

        Cache.SyncCacheStrategy syncCache
        Default:
        de.caluga.morphium.annotations.caching.Cache.SyncCacheStrategy.NONE