java.lang.Object | |
↳ | org.hibernate.LockOptions |
Contains locking details (LockMode, Timeout and Scope).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NO_WAIT | Indicates that the database should not wait at all to acquire the pessimistic lock. | |||||||||
int | WAIT_FOREVER | Indicates that there is no timeout for the acquisition. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NONE | NONE represents LockMode.NONE (timeout + scope do not apply) | ||||||||||
READ | READ represents LockMode.READ (timeout + scope do not apply) | ||||||||||
UPGRADE | UPGRADE represents LockMode.UPGRADE (will wait forever for lock and scope of false meaning only entity is locked) |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Shallow copy From to Dest
| |||||||||||
Get the number of aliases that have specific lock modes defined.
| |||||||||||
Iterator for accessing Alias (key) and LockMode (value) as Map.Entry
| |||||||||||
Get the
LockMode explicitly specified for the given alias via
setAliasSpecificLockMode(String, LockMode)
Differs from getEffectiveLockMode(String) in that here we only return
explicitly specified alias-specific lock modes. | |||||||||||
Determine the
LockMode to apply to the given alias. | |||||||||||
Retrieve the overall lock mode in effect for this set of options.
| |||||||||||
Retrieve the current lock scope setting.
| |||||||||||
Retrieve the current timeout setting.
| |||||||||||
Specify the
LockMode to be used for a specific query alias. | |||||||||||
Set the overall
LockMode to be used. | |||||||||||
Set the cope.
| |||||||||||
Set the timeout setting.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Indicates that the database should not wait at all to acquire the pessimistic lock.
Indicates that there is no timeout for the acquisition.
UPGRADE represents LockMode.UPGRADE (will wait forever for lock and scope of false meaning only entity is locked)
Shallow copy From to Dest
from | is copied from |
---|---|
dest | is copied to |
Get the number of aliases that have specific lock modes defined.
Iterator for accessing Alias (key) and LockMode (value) as Map.Entry
Get the LockMode
explicitly specified for the given alias via
setAliasSpecificLockMode(String, LockMode)
getEffectiveLockMode(String)
in that here we only return
explicitly specified alias-specific lock modes.alias | The alias for which to locate the explicit lock mode. |
---|
Determine the LockMode
to apply to the given alias. If no
mode was explicitly set
, the
overall mode
is returned. If the overall lock mode is
null as well, NONE
is returned.
getAliasSpecificLockMode(String)
in that here we fallback to we only return
the overall lock mode.alias | The alias for which to locate the effective lock mode. |
---|
Retrieve the overall lock mode in effect for this set of options.
In certain contexts (hql and criteria), lock-modes can be defined in an even more granularper-alias
fashionRetrieve the current lock scope setting.
"scope" is a JPA defined term. It is basically a cascading of the lock to associations.Retrieve the current timeout setting.
The timeout is the amount of time, in milliseconds, we should instruct the database to wait for any requested pessimistic lock acquisition.NO_WAIT
and WAIT_FOREVER
represent 2 "magic" values.NO_WAIT
or WAIT_FOREVER
Specify the LockMode
to be used for a specific query alias.
alias | used to reference the LockMode. |
---|---|
lockMode | The lock mode to apply to the given alias |
Set the cope.
scope | The new scope setting |
---|
Set the timeout setting.
SeegetTimeOut()
for a discussion of meaning.timeout | The new timeout setting. |
---|