Package org.apache.openjpa.persistence
Class MixedLockLevelsHelper
java.lang.Object
org.apache.openjpa.persistence.MixedLockLevelsHelper
- All Implemented Interfaces:
HintValueConverter
Helper methods translate between JPA-defined lock mode and OpenJPA
internal lock levels.
- Since:
- 2.0.0
- Author:
- Albert Lee
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.openjpa.persistence.HintValueConverter
HintValueConverter.EnumToInteger, HintValueConverter.OpenJPAEnumToInteger, HintValueConverter.StringToBoolean, HintValueConverter.StringToInteger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class<?> type) Affirm if this receiver can convert the value of the given type.Convert the user-specified value to a kernel consumable value.static jakarta.persistence.LockModeType
fromLockLevel
(int level) Translates internal lock level to jakarta.persistence LockModeType.static int
toLockLevel
(int mode) static int
toLockLevel
(jakarta.persistence.LockModeType mode) Translates jakarta.persistence LockModeType to internal lock level.
-
Constructor Details
-
MixedLockLevelsHelper
public MixedLockLevelsHelper()
-
-
Method Details
-
toLockLevel
public static int toLockLevel(jakarta.persistence.LockModeType mode) Translates jakarta.persistence LockModeType to internal lock level. -
toLockLevel
public static int toLockLevel(int mode) -
fromLockLevel
public static jakarta.persistence.LockModeType fromLockLevel(int level) Translates internal lock level to jakarta.persistence LockModeType. -
canConvert
Description copied from interface:HintValueConverter
Affirm if this receiver can convert the value of the given type.- Specified by:
canConvert
in interfaceHintValueConverter
-
convert
Description copied from interface:HintValueConverter
Convert the user-specified value to a kernel consumable value.- Specified by:
convert
in interfaceHintValueConverter
- Parameters:
original
- the user-specified value- Returns:
- an equivalent value consumable by a kernel construct.
-