Package org.hibernate

Enum FlushMode

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static FlushMode interpretExternalSetting​(java.lang.String externalName)
      Interprets an external representation of the flush mode.
      static boolean isManualFlushMode​(FlushMode mode)
      Deprecated.
      Just use equality check against MANUAL.
      boolean lessThan​(FlushMode other)
      Checks to see if this flush mode is less than the given flush mode.
      static FlushMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FlushMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

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

      • values

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

        public static FlushMode valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • lessThan

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

        @Deprecated
        public static boolean isManualFlushMode​(FlushMode mode)
        Deprecated.
        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.
        Parameters:
        mode - The mode to check
        Returns:
        true/false
      • interpretExternalSetting

        public static FlushMode interpretExternalSetting​(java.lang.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.
        Parameters:
        externalName - The external representation
        Returns:
        The interpreted FlushMode value.
        Throws:
        MappingException - Indicates an unrecognized external representation