Class InjectionHandlerFactory

  • All Implemented Interfaces:
    org.jdbi.v3.sqlobject.HandlerFactory

    public class InjectionHandlerFactory
    extends java.lang.Object
    implements org.jdbi.v3.sqlobject.HandlerFactory
    Sql objects are forced to be interfaces now so it is impossible to inject guice bean (probably other proxy) with field injection. In order to workaround this limitation getter injection must be used: @Inject MyBean getBean();. Handler detects methods annotated with Inject or Inject and return actual guice bean on method call.
    Since:
    17.09.2018
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<org.jdbi.v3.sqlobject.Handler> buildHandler​(java.lang.Class<?> sqlObjectType, java.lang.reflect.Method method)  
      • Methods inherited from class java.lang.Object

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

      • InjectionHandlerFactory

        public InjectionHandlerFactory()
    • Method Detail

      • buildHandler

        public java.util.Optional<org.jdbi.v3.sqlobject.Handler> buildHandler​(java.lang.Class<?> sqlObjectType,
                                                                              java.lang.reflect.Method method)
        Specified by:
        buildHandler in interface org.jdbi.v3.sqlobject.HandlerFactory