Package com.axelor.db
Class JpaModule
java.lang.Object
com.google.inject.AbstractModule
com.axelor.db.JpaModule
- All Implemented Interfaces:
Module
A Guice module to configure JPA.
This module takes care of initializing JPA and registers an Hibernate custom scanner that automatically scans all the classpath entries for Entity classes.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
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
-
JpaModule
Create new instance of theJpaModule
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.- Parameters:
jpaUnit
- the persistence unit nameautoscan
- whether to enable autoscanautostart
- whether to automatically start persistence service
-
JpaModule
Create a new instance of theJpaModule
with the given persistence unit name with autoscan and autostart enabled.- Parameters:
jpaUnit
- the persistence unit name
-
-
Method Details
-
scan
-
configure
protected void configure()- Overrides:
configure
in classAbstractModule
-