Top Description Fields Constructors Methods
org.hibernate.engine

public final Enum OptimisticLockStyle

extends Enum<OptimisticLockStyle>
Class Inheritance
Imports
org.hibernate.AssertionFailure, org.hibernate.annotations.OptimisticLockType

Describes how an entity should be optimistically locked.

API Note

This enumeration is mainly for internal use, since it is isomorphic to OptimisticLockType. In the future, it would be nice to replace them both with a new org.hibernate.OptimisticLockCheck enum.

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final OptimisticLockStyle
ALL

Optimistic locking via comparison of all columns.

public static final OptimisticLockStyle
DIRTY

Optimistic locking via comparison of dirty columns.

public static final OptimisticLockStyle
NONE

No optimistic locking.

public static final OptimisticLockStyle
VERSION

Optimistic locking via a dedicated version or timestamp column.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getOldCode()

Deprecated for removal since 6.2. these integer codes have not been used for a long time
public static OptimisticLockStyle

Returns:

The interpreted enum value
interpretOldCode
(int
The old int constant code
oldCode
)

Deprecated for removal since 6.2. these integer codes have not been used for a long time
Given an old code (one of the int constants from Cascade), interpret it as one of the new enums.
public boolean
public boolean
public boolean
public boolean
public boolean
public static OptimisticLockStyle
public static OptimisticLockStyle[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final OptimisticLockStyle ALL

Optimistic locking via comparison of all columns.

DIRTYback to summary
public static final OptimisticLockStyle DIRTY

Optimistic locking via comparison of dirty columns.

NONEback to summary
public static final OptimisticLockStyle NONE

No optimistic locking.

VERSIONback to summary
public static final OptimisticLockStyle VERSION

Optimistic locking via a dedicated version or timestamp column.

Constructor Detail

OptimisticLockStyleback to summary
private OptimisticLockStyle()

Method Detail

getOldCodeback to summary
public int getOldCode()

Deprecated

for removal since 6.2.

these integer codes have not been used for a long time

Annotations
@Deprecated
since:6.2
forRemoval:true
interpretOldCodeback to summary
public static OptimisticLockStyle interpretOldCode(int oldCode)

Deprecated

for removal since 6.2.

these integer codes have not been used for a long time

Given an old code (one of the int constants from Cascade), interpret it as one of the new enums.

Parameters
oldCode:int

The old int constant code

Returns:OptimisticLockStyle

The interpreted enum value

Annotations
@Deprecated
since:6.2
forRemoval:true
Exceptions
IllegalArgumentException:
If the code did not match any legacy constant.
isAllback to summary
public boolean isAll()
isAllOrDirtyback to summary
public boolean isAllOrDirty()
isDirtyback to summary
public boolean isDirty()
isNoneback to summary
public boolean isNone()
isVersionback to summary
public boolean isVersion()
valueOfback to summary
public static OptimisticLockStyle valueOf(String name)
valuesback to summary
public static OptimisticLockStyle[] values()