org.hibernate.search.annotations
Enum FieldCacheType

java.lang.Object
  extended by java.lang.Enum<FieldCacheType>
      extended by org.hibernate.search.annotations.FieldCacheType
All Implemented Interfaces:
Serializable, Comparable<FieldCacheType>

public enum FieldCacheType
extends Enum<FieldCacheType>

How should we interact with Lucene's FieldCache. FieldCaches can provide a good performance boost but will keep soft references to large arrays of values in memory. This effectively caches stored values from the index to reduce seek times.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.
See Also:
FieldCache

Enum Constant Summary
CLASS
          Cache the entity type.
ID
          Attempts to the object identifier (@DocumentId).
NOTHING
          Disable all caching options.
 
Method Summary
static FieldCacheType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FieldCacheType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOTHING

public static final FieldCacheType NOTHING
Disable all caching options. (ie CLASS, ID) CacheFromIndex(NOTHING) or CacheFromIndex(value=FieldCacheType[]{}) are equivalent.


CLASS

public static final FieldCacheType CLASS
Cache the entity type. This is a good tradeoff in most cases as it enables some optimizations; Depending on the query the type might not be needed, in which case the FieldCache won't be used.


ID

public static final FieldCacheType ID
Attempts to the object identifier (@DocumentId). Not all identifier types are supported.

Method Detail

values

public static FieldCacheType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FieldCacheType c : FieldCacheType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FieldCacheType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved