Package org.hibernate

Enum ScrollMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ScrollMode>

    public enum ScrollMode
    extends java.lang.Enum<ScrollMode>
    Specifies the type of JDBC scrollable result set to use underneath a ScrollableResults.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FORWARD_ONLY
      Requests a scrollable result that is only scrollable forwards.
      SCROLL_INSENSITIVE
      Requests a scrollable result which is insensitive to changes in the underlying data.
      SCROLL_SENSITIVE
      Requests a scrollable result which is sensitive to changes in the underlying data.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean lessThan​(ScrollMode other)
      Determine if this mode is "less than" the provided mode.
      int toResultSetType()
      Get the corresponding JDBC scroll type code constant value.
      static ScrollMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ScrollMode[] 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

      • FORWARD_ONLY

        public static final ScrollMode FORWARD_ONLY
        Requests a scrollable result that is only scrollable forwards.
        See Also:
        ResultSet.TYPE_FORWARD_ONLY
      • SCROLL_SENSITIVE

        public static final ScrollMode SCROLL_SENSITIVE
        Requests a scrollable result which is sensitive to changes in the underlying data.
        See Also:
        ResultSet.TYPE_SCROLL_SENSITIVE
      • SCROLL_INSENSITIVE

        public static final ScrollMode SCROLL_INSENSITIVE
        Requests a scrollable result which is insensitive to changes in the underlying data. Note that since the Hibernate session acts as a cache, you might need to explicitly evict objects, if you need to see changes made by other transactions.
        See Also:
        ResultSet.TYPE_SCROLL_INSENSITIVE
    • Method Detail

      • values

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

        public static ScrollMode 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
      • toResultSetType

        public int toResultSetType()
        Get the corresponding JDBC scroll type code constant value.
        Returns:
        the JDBC result set type code
      • lessThan

        public boolean lessThan​(ScrollMode other)
        Determine if this mode is "less than" the provided mode.
        Parameters:
        other - The provided mode
        Returns:
        true if this mode is less than the other.