程序包 org.hibernate

枚举 CacheMode

    • 枚举常量详细资料

      • NORMAL

        public static final CacheMode NORMAL
        The session may read items from the cache, and add items to the cache.
      • IGNORE

        public static final CacheMode IGNORE
        The session will never interact with the cache, except to invalidate cache items when updates occur.
      • GET

        public static final CacheMode GET
        The session may read items from the cache, but will not add items, except to invalidate items when updates occur.
      • PUT

        public static final CacheMode PUT
        The session will never read items from the cache, but will add items to the cache as it reads them from the database.
      • REFRESH

        public static final CacheMode REFRESH
        The session will never read items from the cache, but will add items to the cache as it reads them from the database. In this mode, the effect of hibernate.cache.use_minimal_puts is bypassed, in order to force a cache refresh.
    • 方法详细资料

      • values

        public static CacheMode[] values()
        按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:
        for (CacheMode c : CacheMode.values())
            System.out.println(c);
        
        返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
      • valueOf

        public static CacheMode valueOf​(String name)
        返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
        参数:
        name - 要返回的枚举常量的名称。
        返回:
        返回带有指定名称的枚举常量
        抛出:
        IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
        NullPointerException - 如果参数为空值
      • isGetEnabled

        public boolean isGetEnabled()
        Does this cache mode indicate that reads are allowed?
        返回:
        true if cache reads are allowed; false otherwise.
      • isPutEnabled

        public boolean isPutEnabled()
        Does this cache mode indicate that writes are allowed?
        返回:
        true if cache writes are allowed; false otherwise.
      • interpretExternalSetting

        public static CacheMode interpretExternalSetting​(String setting)
        Used to interpret externalized forms of this enum.
        参数:
        setting - The externalized form.
        返回:
        The matching enum value.
        抛出:
        MappingException - Indicates the external form was not recognized as a valid enum value.