Package org.hibernate

Interface Timeouts


@Incubating public interface Timeouts
Helpers for dealing with timeout values, including some "magic values".
Since:
7.0
API Note:
The NO_WAIT and SKIP_LOCKED magic values each have a corresponding LockMode (LockMode.UPGRADE_NOWAIT and LockMode.UPGRADE_SKIPLOCKED, respectively).
  • Field Details

  • Method Details

    • interpretMilliSeconds

      static Timeout interpretMilliSeconds(int timeoutInMilliseconds)
      Similar to simply calling Timeout.milliseconds(int), but accounting for the "magic values".
    • isMagicValue

      static boolean isMagicValue(Timeout timeout)
      Whether the given timeout is one of the magic values -
      See Also:
    • isMagicValue

      static boolean isMagicValue(int millis)
      Whether the given value is one of the magic values -
      See Also:
    • isRealTimeout

      static boolean isRealTimeout(Timeout timeout)
      Whether the timeout value is a real value, as opposed to one of the "magic values". Functionally, returns whether the value is greater than zero.
    • isRealTimeout

      static boolean isRealTimeout(int timeoutInMilliseconds)
      Whether the timeout value is a real value, as opposed to one of the "magic values". Functionally, returns whether the value is greater than zero.
    • getTimeoutInSeconds

      static int getTimeoutInSeconds(Timeout timeout)
      Get the number of (whole) seconds represented by the given timeout.
    • getTimeoutInSeconds

      static int getTimeoutInSeconds(int timeoutInMilliseconds)
      Get the number of (whole) seconds represented by the given timeout.
    • fromHint

      static int fromHint(Object factoryHint)