Class CacheIndex

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class CacheIndex
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable

    Purpose: Define a secondary index on the cache.

    See Also:
    CachePolicy, Serialized Form
    • Field Detail

      • isUpdateable

        protected boolean isUpdateable
      • isInsertable

        protected boolean isInsertable
      • cacheSize

        protected int cacheSize
        Allows the cache size to be set.
      • cacheType

        protected java.lang.Class cacheType
        Allows the identity map class type to be set.
    • Constructor Detail

      • CacheIndex

        public CacheIndex()
      • CacheIndex

        public CacheIndex​(java.lang.String... fields)
      • CacheIndex

        public CacheIndex​(java.util.List<DatabaseField> fields)
    • Method Detail

      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • isUpdateable

        public boolean isUpdateable()
        Return if the index field can be updated.
      • setIsUpdateable

        public void setIsUpdateable​(boolean isUpdateable)
        Set if the index field can be updated. If updateable the object will be re-indexed on each update/refresh.
      • isInsertable

        public boolean isInsertable()
        Return if the index field can be inserted.
      • setIsInsertable

        public void setIsInsertable​(boolean isInsertable)
        Set if the index field can be inserted. If insertable the object will be indexed after insert.
      • getCacheType

        public java.lang.Class getCacheType()
        ADVANCED: Return the type of the cache used for the index. This default to a weak cache, and should normally not be changed. For a weak cache, the index will remain until the object gcs from the main cache.
      • setCacheType

        public void setCacheType​(java.lang.Class cacheType)
        ADVANCED: Set the type of the cache used for the index. This default to a weak cache, and should normally not be changed. For a weak cache, the index will remain until the object gcs from the main cache.
      • getCacheSize

        public int getCacheSize()
        ADVANCED: Return the cache size. This is either the initial size, sub-cache size, or fixed size depending on the cache type.
      • setCacheSize

        public void setCacheSize​(int cacheSize)
        ADVANCED: Set the cache size. This is either the initial size, sub-cache size, or fixed size depending on the cache type.
      • addFieldName

        public void addFieldName​(java.lang.String field)
        PUBLIC: Add the database column name to the cache index.
      • setFields

        public void setFields​(java.util.List<DatabaseField> fields)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object