Package org.hibernate.annotations
Enum CacheLayout
- java.lang.Object
-
- java.lang.Enum<CacheLayout>
-
- org.hibernate.annotations.CacheLayout
-
- All Implemented Interfaces:
Serializable
,Comparable<CacheLayout>
@Incubating public enum CacheLayout extends Enum<CacheLayout>
Describes the data layout used for storing an object into the query cache.The query cache can either store the full state of an entity or collection, or store only the identifier and discriminator if needed. Both approaches have pros and cons, but ultimately it's advisable to us a shallow layout if the chances are high, that the object will be contained in the second level cache.
- Since:
- 6.5
- See Also:
QueryCacheLayout
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTO
FULL
Stores the full state into the query cache.SHALLOW
Uses a cache layout that only stores the identifier of the entity or collection.SHALLOW_WITH_DISCRIMINATOR
LikeSHALLOW
but will also store the entity discriminator.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheLayout
valueOf(String name)
Returns the enum constant of this type with the specified name.static CacheLayout[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AUTO
public static final CacheLayout AUTO
-
SHALLOW
public static final CacheLayout SHALLOW
Uses a cache layout that only stores the identifier of the entity or collection. This is useful when the chances for the object being part of the second level cache are very high.
-
SHALLOW_WITH_DISCRIMINATOR
public static final CacheLayout SHALLOW_WITH_DISCRIMINATOR
LikeSHALLOW
but will also store the entity discriminator.
-
FULL
public static final CacheLayout FULL
Stores the full state into the query cache. This is useful when the chances for the object being part of the second level cache are very low.
-
-
Method Detail
-
values
public static CacheLayout[] 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 (CacheLayout c : CacheLayout.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CacheLayout 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 nameNullPointerException
- if the argument is null
-
-