Package org.hibernate.annotations
Enum Class CacheLayout
- All Implemented Interfaces:
Serializable
,Comparable<CacheLayout>
,Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionStores the full state into the query cache.Uses a cache layout that only stores the identifier of the entity or collection.LikeSHALLOW
but will also store the entity discriminator. -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheLayout
Returns the enum constant of this class with the specified name.static CacheLayout[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
-
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
LikeSHALLOW
but will also store the entity discriminator. -
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 Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-