Enum EntityLoadingCacheLookupStrategy
- java.lang.Object
-
- java.lang.Enum<EntityLoadingCacheLookupStrategy>
-
- org.hibernate.search.mapper.orm.search.loading.EntityLoadingCacheLookupStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<EntityLoadingCacheLookupStrategy>
public enum EntityLoadingCacheLookupStrategy extends Enum<EntityLoadingCacheLookupStrategy>
Strategy for cache lookup before search query results are loaded.In most cases, no presence check is necessary.
- Author:
- Emmanuel Bernard
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PERSISTENCE_CONTEXT
When a search query returns entities, first check the persistence context to retrieve entities that are already in the session, then load the entities that were not found in the session through an SQL query.PERSISTENCE_CONTEXT_THEN_SECOND_LEVEL_CACHE
When a search query returns entities, first check the persistence context to retrieve entities that are already in the session, then check the second level cache to retrieve entities that are in the 2LC but not in the session, then load the entities that were not found in the session or 2LC through an SQL query.SKIP
When a search query returns entities, do not check any cache and load all the entities through an SQL query.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
externalRepresentation()
static EntityLoadingCacheLookupStrategy
of(String value)
static EntityLoadingCacheLookupStrategy
valueOf(String name)
Returns the enum constant of this type with the specified name.static EntityLoadingCacheLookupStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SKIP
public static final EntityLoadingCacheLookupStrategy SKIP
When a search query returns entities, do not check any cache and load all the entities through an SQL query.This is the default strategy.
-
PERSISTENCE_CONTEXT
public static final EntityLoadingCacheLookupStrategy PERSISTENCE_CONTEXT
When a search query returns entities, first check the persistence context to retrieve entities that are already in the session, then load the entities that were not found in the session through an SQL query.
-
PERSISTENCE_CONTEXT_THEN_SECOND_LEVEL_CACHE
public static final EntityLoadingCacheLookupStrategy PERSISTENCE_CONTEXT_THEN_SECOND_LEVEL_CACHE
When a search query returns entities, first check the persistence context to retrieve entities that are already in the session, then check the second level cache to retrieve entities that are in the 2LC but not in the session, then load the entities that were not found in the session or 2LC through an SQL query.
-
-
Method Detail
-
values
public static EntityLoadingCacheLookupStrategy[] 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 (EntityLoadingCacheLookupStrategy c : EntityLoadingCacheLookupStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EntityLoadingCacheLookupStrategy 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
-
of
public static EntityLoadingCacheLookupStrategy of(String value)
-
externalRepresentation
public String externalRepresentation()
- Returns:
- The expected string representation in configuration properties.
-
-