Enum UnitOfWork.CommitOrderType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UnitOfWork.CommitOrderType>
    Enclosing interface:
    UnitOfWork

    public static enum UnitOfWork.CommitOrderType
    extends java.lang.Enum<UnitOfWork.CommitOrderType>
    Defines the ordering of updates and deletes of a set of the same entity type during a commit or flush operation. The commit order of entities is defined by their foreign key constraints, and then sorted alphabetically.

    By default the commit of a set of the same entity type is ordered by primary key.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CHANGES
      Updates are ordered by the object's changes, then by id.
      ID
      Updates and deletes are ordered by the object's id.
      NONE
      No ordering is done.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UnitOfWork.CommitOrderType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UnitOfWork.CommitOrderType[] 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

      • ID

        public static final UnitOfWork.CommitOrderType ID
        Updates and deletes are ordered by the object's id. This can help avoid deadlocks on highly concurrent systems.
      • CHANGES

        public static final UnitOfWork.CommitOrderType CHANGES
        Updates are ordered by the object's changes, then by id. This can improve batch writing efficiency.
    • Method Detail

      • values

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

        public static UnitOfWork.CommitOrderType 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