Enum Class AccessType

java.lang.Object
java.lang.Enum<AccessType>
org.hibernate.cache.spi.access.AccessType
All Implemented Interfaces:
Serializable, Comparable<AccessType>, Constable

public enum AccessType extends Enum<AccessType>
Enumerates the policies for managing concurrent access to the shared second-level cache.
API Note:
This enumeration is isomorphic to CacheConcurrencyStrategy. We don't really need both, but one is part of this SPI, and one forms part of the API of the annotations package. In the future, it would be nice to replace them both with a new org.hibernate.CacheConcurrencyPolicy enum.
  • Enum Constant Details

    • READ_ONLY

      public static final AccessType READ_ONLY
      Read-only access. Data may be added and removed, but not mutated.
    • READ_WRITE

      public static final AccessType READ_WRITE
      Read and write access. Data may be added, removed and mutated. A "soft" lock on the cached item is used to manage concurrent access during mutation.
    • NONSTRICT_READ_WRITE

      public static final AccessType NONSTRICT_READ_WRITE
      Read and write access. Data may be added, removed and mutated. The cached item is invalidated before and after transaction completion to manage concurrent access during mutation. This strategy is more vulnerable to inconsistencies than READ_WRITE, but may allow higher throughput.
    • TRANSACTIONAL

      public static final AccessType TRANSACTIONAL
      Read and write access. Data may be added, removed and mutated. Some sort of hard lock is maintained in conjunction with a JTA transaction.
  • Method Details

    • values

      public static AccessType[] 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 AccessType 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
    • getExternalName

      public String getExternalName()
      Get the external name of this value.
      Returns:
      The corresponding externalized name.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<AccessType>
    • fromExternalName

      public static AccessType fromExternalName(@Nullable String externalName)
      Resolve an AccessType from its external name.
      Parameters:
      externalName - The external representation to resolve
      Returns:
      The AccessType represented by the given external name
      Throws:
      UnknownAccessTypeException - if the external name was not recognized
      See Also: