public class JpaModule extends AbstractModule
This module takes care of initializing JPA and registers an Hibernate custom scanner that automatically scans all the classpath entries for Entity classes.
Modifier and Type | Class and Description |
---|---|
static class |
JpaModule.Initializer |
Constructor and Description |
---|
JpaModule(String jpaUnit)
Create a new instance of the
JpaModule with the given persistence unit name with
autoscan and autostart enabled. |
JpaModule(String jpaUnit,
boolean autoscan,
boolean autostart)
Create new instance of the
JpaModule with the given persistence unit name. |
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
JpaModule |
scan(String pkg) |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
public JpaModule(String jpaUnit, boolean autoscan, boolean autostart)
JpaModule
with the given persistence unit name.
If autoscan is true then a custom Hibernate scanner will be used to scan all the classpath entries for Entity classes.
If autostart is true then the PersistService
will be started automatically.
jpaUnit
- the persistence unit nameautoscan
- whether to enable autoscanautostart
- whether to automatically start persistence serviceprotected void configure()
configure
in class AbstractModule