Interface SqlObject

  • All Known Subinterfaces:
    Transactional<This>

    public interface SqlObject
    SqlObject base interface. All synthesized implementations implement this interface, even if the declaration doesn't extend SqlObject. Custom mixins may be written as subinterfaces of this class with default methods.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Handle getHandle()
      Returns the handle used in the current sql object context.
      default <X extends java.lang.Exception>
      void
      useHandle​(HandleConsumer<X> consumer)
      A convenience function which manages the lifecycle of the handle associated to this sql object, and yields it to a consumer for use by clients.
      <R,​X extends java.lang.Exception>
      R
      withHandle​(HandleCallback<R,​X> callback)
      A convenience function which manages the lifecycle of the handle associated to this sql object, and yields it to a callback for use by clients.
    • Method Detail

      • getHandle

        Handle getHandle()
        Returns the handle used in the current sql object context.
        Returns:
        the handle used in the current sql object context.
      • withHandle

        <R,​X extends java.lang.Exception> R withHandle​(HandleCallback<R,​X> callback)
                                                      throws X extends java.lang.Exception
        A convenience function which manages the lifecycle of the handle associated to this sql object, and yields it to a callback for use by clients.
        Type Parameters:
        R - type returned by the callback
        X - exception type thrown by the callback, if any.
        Parameters:
        callback - A callback which will receive the handle associated to this sql object
        Returns:
        the value returned by callback
        Throws:
        X - any exception thrown by the callback
        X extends java.lang.Exception
      • useHandle

        default <X extends java.lang.Exception> void useHandle​(HandleConsumer<X> consumer)
                                                        throws X extends java.lang.Exception
        A convenience function which manages the lifecycle of the handle associated to this sql object, and yields it to a consumer for use by clients.
        Type Parameters:
        X - exception type thrown by the callback, if any.
        Parameters:
        consumer - A consumer which will receive the handle associated to this sql object
        Throws:
        X - any exception thrown by the callback
        X extends java.lang.Exception