Enum AccessType

  • All Implemented Interfaces:
    Serializable, Comparable<AccessType>

    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 Detail

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

      • values

        public static AccessType[] 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 (AccessType c : AccessType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AccessType 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 name
        NullPointerException - if the argument is null
      • getExternalName

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