Class 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
    • Constructor Detail

      • MixedLockLevelsHelper

        public MixedLockLevelsHelper()
    • 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 interface HintValueConverter
      • 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 interface HintValueConverter
        Parameters:
        original - the user-specified value
        Returns:
        an equivalent value consumable by a kernel construct.