Enum UnitOfWork.CommitOrderType

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

    public static enum UnitOfWork.CommitOrderType
    extends 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 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​(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