Package ru.vyarus.guicey.jdbi3.module
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
ConstructorsConstructorDescriptionJdbiModule(org.jdbi.v3.core.Jdbi jdbi, List<Class<? extends Annotation>> txAnnotations) Create jdbi module. -
Method Summary
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
-
Constructor Details
-
JdbiModule
Create jdbi module.- Parameters:
jdbi- jdbi instancetxAnnotations- transaction annotations
-
-
Method Details
-
configure
protected void configure()- Overrides:
configurein classcom.google.inject.AbstractModule
-