Package org.hibernate.cache.jcache
Enum MissingCacheStrategy
- java.lang.Object
-
- java.lang.Enum<MissingCacheStrategy>
-
- org.hibernate.cache.jcache.MissingCacheStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MissingCacheStrategy>
public enum MissingCacheStrategy extends java.lang.Enum<MissingCacheStrategy>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CREATE
Create a new cache when a cache is not found, without logging any warning about the missing cache.CREATE_WARN
Create a new cache when a cache is not found (seeCREATE
), and also log a warning about the missing cache.FAIL
Fail with an exception on missing caches.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getExternalRepresentation()
static MissingCacheStrategy
interpretSetting(java.lang.Object value)
static MissingCacheStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MissingCacheStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FAIL
public static final MissingCacheStrategy FAIL
Fail with an exception on missing caches.
-
CREATE_WARN
public static final MissingCacheStrategy CREATE_WARN
Create a new cache when a cache is not found (seeCREATE
), and also log a warning about the missing cache.
-
CREATE
public static final MissingCacheStrategy CREATE
Create a new cache when a cache is not found, without logging any warning about the missing cache. Note that caches created this way may be very badly configured (unlimited size and no eviction in particular) unless the cache provider was explicitly configured to use an appropriate configuration for default caches. Ehcache in particular allows to set such default configuration using cache templates, see http://www.ehcache.org/documentation/3.0/107.html#supplement-jsr-107-configurations
-
-
Method Detail
-
values
public static MissingCacheStrategy[] 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 (MissingCacheStrategy c : MissingCacheStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MissingCacheStrategy valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getExternalRepresentation
public java.lang.String getExternalRepresentation()
-
interpretSetting
public static MissingCacheStrategy interpretSetting(java.lang.Object value)
-
-