Package org.apache.openjpa.persistence
Class MixedLockLevelsHelper
- java.lang.Object
-
- org.apache.openjpa.persistence.MixedLockLevelsHelper
-
- All Implemented Interfaces:
HintValueConverter
public class MixedLockLevelsHelper extends java.lang.Object implements 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
Constructors Constructor Description MixedLockLevelsHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(java.lang.Class<?> type)
Affirm if this receiver can convert the value of the given type.java.lang.Object
convert(java.lang.Object original)
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.
-
-
-
Method Detail
-
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
public boolean canConvert(java.lang.Class<?> type)
Description copied from interface:HintValueConverter
Affirm if this receiver can convert the value of the given type.- Specified by:
canConvert
in interfaceHintValueConverter
-
convert
public java.lang.Object convert(java.lang.Object original)
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.
-
-