Module eclipselink

Class CacheIndex

java.lang.Object
org.eclipse.persistence.descriptors.CacheIndex
All Implemented Interfaces:
Serializable, Cloneable

public class CacheIndex extends Object implements Cloneable, Serializable

Purpose: Define a secondary index on the cache.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    Allows the cache size to be set.
    protected Class<? extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap>
    Allows the identity map class type to be set.
    protected List<org.eclipse.persistence.internal.helper.DatabaseField>
     
    protected boolean
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    CacheIndex(String... fields)
     
    CacheIndex(List<org.eclipse.persistence.internal.helper.DatabaseField> fields)
     
    CacheIndex(org.eclipse.persistence.internal.helper.DatabaseField[] fields)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addField(org.eclipse.persistence.internal.helper.DatabaseField field)
     
    void
    PUBLIC: Add the database column name to the cache index.
     
    int
    ADVANCED: Return the cache size.
    <T extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap>
    Class<T>
    ADVANCED: Return the type of the cache used for the index.
    List<org.eclipse.persistence.internal.helper.DatabaseField>
     
    boolean
    Return if the index field can be inserted.
    boolean
    Return if the index field can be updated.
    void
    setCacheSize(int cacheSize)
    ADVANCED: Set the cache size.
    void
    setCacheType(Class<? extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap> cacheType)
    ADVANCED: Set the type of the cache used for the index.
    void
    setFields(List<org.eclipse.persistence.internal.helper.DatabaseField> fields)
     
    void
    setIsInsertable(boolean isInsertable)
    Set if the index field can be inserted.
    void
    setIsUpdateable(boolean isUpdateable)
    Set if the index field can be updated.
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • isUpdateable

      protected boolean isUpdateable
    • isInsertable

      protected boolean isInsertable
    • fields

      protected List<org.eclipse.persistence.internal.helper.DatabaseField> fields
    • cacheSize

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

      protected Class<? extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap> cacheType
      Allows the identity map class type to be set.
  • Constructor Details

    • CacheIndex

      public CacheIndex()
    • CacheIndex

      public CacheIndex(org.eclipse.persistence.internal.helper.DatabaseField[] fields)
    • CacheIndex

      public CacheIndex(String... fields)
    • CacheIndex

      public CacheIndex(List<org.eclipse.persistence.internal.helper.DatabaseField> fields)
  • Method Details

    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      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 <T extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap> Class<T> 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(Class<? extends org.eclipse.persistence.internal.identitymaps.WeakIdentityMap> 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.
    • addField

      public void addField(org.eclipse.persistence.internal.helper.DatabaseField field)
    • addFieldName

      public void addFieldName(String field)
      PUBLIC: Add the database column name to the cache index.
    • getFields

      public List<org.eclipse.persistence.internal.helper.DatabaseField> getFields()
    • setFields

      public void setFields(List<org.eclipse.persistence.internal.helper.DatabaseField> fields)
    • toString

      public String toString()
      Overrides:
      toString in class Object