Package org.hibernate

Enum FlushMode

    • 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.
      • 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.
    • 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​(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
      • 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​(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