Package org.hibernate

Enum Class OrderingMode

java.lang.Object
java.lang.Enum<OrderingMode>
org.hibernate.OrderingMode
All Implemented Interfaces:
FindOption, Serializable, Comparable<OrderingMode>, Constable, FindMultipleOption

@Incubating public enum OrderingMode extends Enum<OrderingMode> implements FindMultipleOption
Indicates whether the result list should be ordered relative to the position of the identifier list. E.g.
 List<Person> results = session.findMultiple(
     Person.class,
     List.of(1,2,3,2),
     ORDERED
 );
 assert results.get(0).getId() == 1;
 assert results.get(1).getId() == 2;
 assert results.get(2).getId() == 3;
 assert results.get(3).getId() == 2;
 

The default is ORDERED.

Since:
7.2
See Also:
  • Enum Constant Details

    • ORDERED

      public static final OrderingMode ORDERED
      The default. The result list is ordered relative to the position of the identifiers list.
      See Also:
    • UNORDERED

      public static final OrderingMode UNORDERED
      The result list may be in any order.
  • Method Details

    • values

      public static OrderingMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OrderingMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null