Class JdbiModule

java.lang.Object
com.google.inject.AbstractModule
ru.vyarus.guicey.jdbi3.module.JdbiModule
All Implemented Interfaces:
com.google.inject.Module

public class JdbiModule extends com.google.inject.AbstractModule
Jdbi support guice module. Binds Jdbi for injection. Introduce unit of work concept for JDBI: thread-bound handle must be created in order to access db (work with db only inside unit of work). Assumed that repositories will be installed with RepositoryInstaller, which will customize instances to support unit of work. Also, customized instances support guice aop.

It is assumed that in most cases unit of work will be defined together with transaction using transaction annotation (one or more). By default, only InTransaction annotation will be recognized.

Since:
31.08.2018
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdbiModule(org.jdbi.v3.core.Jdbi jdbi, List<Class<? extends Annotation>> txAnnotations)
    Create jdbi module.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     

    Methods inherited from class com.google.inject.AbstractModule

    addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestInjection, requestStaticInjection, requireBinding, requireBinding

    Methods inherited from class java.lang.Object

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

    • JdbiModule

      public JdbiModule(org.jdbi.v3.core.Jdbi jdbi, List<Class<? extends Annotation>> txAnnotations)
      Create jdbi module.
      Parameters:
      jdbi - jdbi instance
      txAnnotations - transaction annotations
  • Method Details

    • configure

      protected void configure()
      Overrides:
      configure in class com.google.inject.AbstractModule