Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors

public Class CacheIndex

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.Serializable, java.util.ArrayList, .Collections, .List, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, org.eclipse.persistence.internal.identitymaps.IdentityMap, .WeakIdentityMap

Purpose: Define a secondary index on the cache.

See Also
CachePolicy

Field Summary

Modifier and TypeField and Description
protected int
cacheSize

Allows the cache size to be set.

protected Class<? extends WeakIdentityMap>
cacheType

Allows the identity map class type to be set.

protected List<DatabaseField>
protected boolean
protected boolean

Constructor Summary

AccessConstructor and Description
public
public
public
CacheIndex(String... fields)

public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addFieldName(String field)

PUBLIC: Add the database column name to the cache index.

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public int
getCacheSize()

ADVANCED: Return the cache size.

public <T extends WeakIdentityMap> Class<T>
getCacheType()

ADVANCED: Return the type of the cache used for the index.

public List<DatabaseField>
public boolean
isInsertable()

Return if the index field can be inserted.

public boolean
isUpdateable()

Return if the index field can be updated.

public void
setCacheSize(int cacheSize)

ADVANCED: Set the cache size.

public void
setCacheType(Class<? extends WeakIdentityMap> cacheType)

ADVANCED: Set the type of the cache used for the index.

public void
public void
setIsInsertable(boolean isInsertable)

Set if the index field can be inserted.

public void
setIsUpdateable(boolean isUpdateable)

Set if the index field can be updated.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cacheSizeback to summary
protected int cacheSize

Allows the cache size to be set.

cacheTypeback to summary
protected Class<? extends WeakIdentityMap> cacheType

Allows the identity map class type to be set.

fieldsback to summary
protected List<DatabaseField> fields
isInsertableback to summary
protected boolean isInsertable
isUpdateableback to summary
protected boolean isUpdateable

Constructor Detail

CacheIndexback to summary
public CacheIndex()
CacheIndexback to summary
public CacheIndex(DatabaseField[] fields)
CacheIndexback to summary
public CacheIndex(String... fields)
CacheIndexback to summary
public CacheIndex(List<DatabaseField> fields)

Method Detail

addFieldback to summary
public void addField(DatabaseField field)
addFieldNameback to summary
public void addFieldName(String field)

PUBLIC: Add the database column name to the cache index.

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
getCacheSizeback to summary
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.

getCacheTypeback to summary
public <T extends 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.

Annotations
@SuppressWarnings:unchecked
getFieldsback to summary
public List<DatabaseField> getFields()
isInsertableback to summary
public boolean isInsertable()

Return if the index field can be inserted.

isUpdateableback to summary
public boolean isUpdateable()

Return if the index field can be updated.

setCacheSizeback to summary
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.

setCacheTypeback to summary
public void setCacheType(Class<? extends 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.

setFieldsback to summary
public void setFields(List<DatabaseField> fields)
setIsInsertableback to summary
public void setIsInsertable(boolean isInsertable)

Set if the index field can be inserted. If insertable the object will be indexed after insert.

setIsUpdateableback to summary
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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override