Class SqlObjectProvider<T>

  • Type Parameters:
    T - sql proxy type
    All Implemented Interfaces:
    jakarta.inject.Provider<T>

    public class SqlObjectProvider<T>
    extends java.lang.Object
    implements jakarta.inject.Provider<T>
    Factory re-implements Jdbi.onDemand(Class) in order to create proxy, using transactional handler (jdbi on-demand objects supposed to open-close connection on each call).

    Proxy is not created immediately because during proxy creation config is created for each method and so if some global row mapper will be registered after this moment, method config will not know about it. Provider is created just before injector creation and all mappers are registered just after injector creation, so without laziness nothing would work as planned.

    Since:
    13.09.2018
    • Constructor Summary

      Constructors 
      Constructor Description
      SqlObjectProvider​(java.lang.Class<T> extensionType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      boolean isInitialized()
      Method used only for testing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SqlObjectProvider

        public SqlObjectProvider​(java.lang.Class<T> extensionType)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface jakarta.inject.Provider<T>
      • isInitialized

        public boolean isInitialized()
        Method used only for testing.
        Returns:
        true if jdbi proxy created, false if not