Enum Class EntityLoadingCacheLookupStrategy

java.lang.Object
java.lang.Enum<EntityLoadingCacheLookupStrategy>
org.hibernate.search.mapper.orm.search.loading.EntityLoadingCacheLookupStrategy
All Implemented Interfaces:
Serializable, Comparable<EntityLoadingCacheLookupStrategy>, Constable

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 Details

    • 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 Details

    • values

      public static EntityLoadingCacheLookupStrategy[] 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

      public static EntityLoadingCacheLookupStrategy valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      public static EntityLoadingCacheLookupStrategy of(String value)
    • externalRepresentation

      public String externalRepresentation()
      Returns:
      The expected string representation in configuration properties.