Class MixedLockLevelsHelper

java.lang.Object
org.apache.openjpa.persistence.MixedLockLevelsHelper
All Implemented Interfaces:
HintValueConverter

public class MixedLockLevelsHelper extends Object implements HintValueConverter
Helper methods translate between JPA-defined lock mode and OpenJPA internal lock levels.
Since:
2.0.0
Author:
Albert Lee
  • 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

      public boolean canConvert(Class<?> type)
      Description copied from interface: HintValueConverter
      Affirm if this receiver can convert the value of the given type.
      Specified by:
      canConvert in interface HintValueConverter
    • convert

      public Object convert(Object original)
      Description copied from interface: HintValueConverter
      Convert the user-specified value to a kernel consumable value.
      Specified by:
      convert in interface HintValueConverter
      Parameters:
      original - the user-specified value
      Returns:
      an equivalent value consumable by a kernel construct.