Class RepositoryInstaller
java.lang.Object
ru.vyarus.guicey.jdbi3.installer.repository.RepositoryInstaller
- All Implemented Interfaces:
ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller,ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
public class RepositoryInstaller
extends Object
implements ru.vyarus.dropwizard.guice.module.installer.FeatureInstaller, ru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
Recognize classes annotated with
JdbiRepository and register them. Such classes may be then
injected as usual beans and used as usual daos. All daos will participate in the thread-bound transaction,
declared by transaction annotation, transaction template or manually with unit manager.
Dao may use any guice-related annotations because beans participate in guice aop. This is done by creating special guice-managed proxy class (where guice could apply aop). These proxies delegate all method calls to JDBI-managed proxies.
Manual guice bindings are not allowed, except one case: bind(Base.class).to(Repo.class) where
Repo.class is a recognizable (annotated) repository. This case useful for generifying repositories
(so implementation with exact queries could be pluggable).
- Since:
- 31.08.2018
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGuice interceptor redirects calls from guice repository bean into jdbi proxy instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidextensionBound(com.google.inject.Stage stage, Class<?> type) <T> voidmanualBinding(com.google.inject.Binder binder, Class<T> type, com.google.inject.Binding<T> binding) booleanvoidreport()
-
Constructor Details
-
RepositoryInstaller
public RepositoryInstaller()
-
-
Method Details
-
matches
- Specified by:
matchesin interfaceru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
-
bind
- Specified by:
bindin interfaceru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
-
manualBinding
public <T> void manualBinding(com.google.inject.Binder binder, Class<T> type, com.google.inject.Binding<T> binding) - Specified by:
manualBindingin interfaceru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
-
extensionBound
- Specified by:
extensionBoundin interfaceru.vyarus.dropwizard.guice.module.installer.install.binding.BindingInstaller
-
report
public void report()- Specified by:
reportin interfaceru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
-
getRecognizableSigns
- Specified by:
getRecognizableSignsin interfaceru.vyarus.dropwizard.guice.module.installer.FeatureInstaller
-