Package org.hibernate.cache.jcache
Enum MissingCacheStrategy
- java.lang.Object
-
- java.lang.Enum<MissingCacheStrategy>
-
- org.hibernate.cache.jcache.MissingCacheStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<MissingCacheStrategy>
public enum MissingCacheStrategy extends 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 String
getExternalRepresentation()
static MissingCacheStrategy
interpretSetting(Object value)
static MissingCacheStrategy
valueOf(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(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
-
getExternalRepresentation
public String getExternalRepresentation()
-
interpretSetting
public static MissingCacheStrategy interpretSetting(Object value)
-
-