程序包 org.hibernate

枚举 FlushMode

    • 枚举常量详细资料

      • MANUAL

        public static final FlushMode MANUAL
        The Session is only ever flushed when Session.flush() is explicitly called by the application. This mode is very efficient for read only transactions.
      • COMMIT

        public static final FlushMode COMMIT
        The Session is flushed when EntityTransaction.commit() is called.
      • AUTO

        public static final FlushMode AUTO
        The Session is sometimes flushed before query execution in order to ensure that queries never return stale state. This is the default flush mode.
      • ALWAYS

        public static final FlushMode ALWAYS
        The Session is flushed before every query. This is almost always unnecessary and inefficient.
    • 方法详细资料

      • values

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

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

        public boolean lessThan​(FlushMode other)
        Checks to see if this flush mode is less than the given flush mode.
        参数:
        other - THe flush mode value to be checked against this
        返回:
        true indicates other is less than this; false otherwise
      • isManualFlushMode

        @Deprecated
        public static boolean isManualFlushMode​(FlushMode mode)
        已过时。
        Just use equality check against MANUAL. Legacy from before this was an enum
        Checks to see if the given mode is the same as MANUAL.
        参数:
        mode - The mode to check
        返回:
        true/false
      • interpretExternalSetting

        public static FlushMode interpretExternalSetting​(String externalName)
        Interprets an external representation of the flush mode. null is returned as null, otherwise valueOf(String) is used with the upper-case version of the incoming value. An unknown, non-null value results in a MappingException being thrown.
        参数:
        externalName - The external representation
        返回:
        The interpreted FlushMode value.
        抛出:
        MappingException - Indicates an unrecognized external representation