Enum Class PessimisticLockScope
- All Implemented Interfaces:
FindOption, LockOption, RefreshOption, TypedQuery.Option, Serializable, Comparable<PessimisticLockScope>, Constable
A PessimisticLockScope may be passed:
- as a
FindOption,RefreshOption, orLockOption, - as an argument to
TypedQuery.setLockScope(PessimisticLockScope), or - as the value of
NamedQuery.lockScope().
Alternatively, it may be specified via the configuration
property jakarta.persistence.lock.scope. This property
may be passed as an argument to methods of EntityManager
which accept a LockModeType, or to Query.setHint(String, Object),
or it may be specified via NamedQuery.hints().
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe persistence provider must lock the row or rows of: the primary and secondary tables mapped by the entity, including all rows in tables mapped by the entity superclasses of the entity in the case of a joined inheritance hierarchy, join tables mapped by associations owned by the entity, and collection tables mapped by collections belonging to the entity.The persistence provider must lock the row or rows of: the primary and secondary tables mapped by the entity, including all rows in tables mapped by the entity superclasses of the entity in the case of a joined inheritance hierarchy, join tables mapped by associations which were fetched as part of the operation which obtained the pessimistic lock, along with the primary and secondary tables mapped by the associated entities, collection tables mapped by collections belonging to the entity which were fetched as part of the operation which obtained the pessimistic lock. -
Method Summary
Modifier and TypeMethodDescriptionstatic PessimisticLockScopeReturns the enum constant of this class with the specified name.static PessimisticLockScope[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORMAL
The persistence provider must lock the row or rows of the primary and secondary tables mapped by the entity. In the case of a joined inheritance hierarchy, this includes all rows in tables mapped by the entity superclasses of the entity.
The pessimistic lock does not extend to rows of:
- tables mapped by associated entities,
- join tables mapped by associations, or
- collection tables.
This is the default behavior of pessimistic locking.
-
EXTENDED
The persistence provider must lock the row or rows of:
- the primary and secondary tables mapped by the entity, including all rows in tables mapped by the entity superclasses of the entity in the case of a joined inheritance hierarchy,
- join tables mapped by associations owned by the entity, and
- collection tables mapped by collections belonging to the entity.
The pessimistic lock does not extend to rows of:
- tables mapped by associated entities,
- join tables mapped by associations not owned by the entity.
-
FETCHED
The persistence provider must lock the row or rows of:
- the primary and secondary tables mapped by the entity, including all rows in tables mapped by the entity superclasses of the entity in the case of a joined inheritance hierarchy,
- join tables mapped by associations which were fetched as part of the operation which obtained the pessimistic lock, along with the primary and secondary tables mapped by the associated entities,
- collection tables mapped by collections belonging to the entity which were fetched as part of the operation which obtained the pessimistic lock.
The pessimistic lock does not extend to data which was not fetched as part of the operation which obtained the pessimistic lock.
- Since:
- 4.0
-
-
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
-