Package org.hibernate.annotations
Enum Class OptimisticLockType
- All Implemented Interfaces:
Serializable,Comparable<OptimisticLockType>,Constable
Enumerates the possible optimistic lock checking strategies.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOptimistic locking based on all fields of the entity.Optimistic locking based on dirty fields of the entity.No optimistic locking.Optimistic locking using a dedicated timestamp column or version column. -
Method Summary
Modifier and TypeMethodDescriptionstatic OptimisticLockTypeReturns the enum constant of this class with the specified name.static OptimisticLockType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No optimistic locking. -
VERSION
Optimistic locking using a dedicated timestamp column or version column. This is the usual strategy.Any SQL
updateordeletestatement will have awhereclause restriction which specifies the primary key and current version. If no rows are updated, this is interpreted as a lock checking failure.- See Also:
-
DIRTY
Optimistic locking based on dirty fields of the entity.A SQL
updateordeletestatement will have every dirty field of the entity instance listed in thewhereclause restriction. -
ALL
Optimistic locking based on all fields of the entity.A SQL
updateordeletestatement will have every field of the entity listed in thewhereclause restriction.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-