public abstract class HibernateBundle<T> extends Object implements ConfiguredBundle<T>, DatabaseConfiguration<T>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME |
Modifier | Constructor and Description |
---|---|
protected |
HibernateBundle(Class<?> entity,
Class<?>... entities) |
protected |
HibernateBundle(List<Class<?>> entities,
SessionFactoryFactory sessionFactoryFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
configure(org.hibernate.cfg.Configuration configuration) |
protected com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module |
createHibernate5Module()
Override to configure the
Hibernate5Module . |
org.hibernate.SessionFactory |
getSessionFactory() |
void |
initialize(Bootstrap<?> bootstrap)
Initializes the application bootstrap.
|
boolean |
isLazyLoadingEnabled() |
protected String |
name()
Override to configure the name of the bundle
(It's used for the bundle health check and database pool metrics)
|
void |
run(T configuration,
Environment environment)
Initializes the environment.
|
void |
setLazyLoadingEnabled(boolean lazyLoadingEnabled) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataSourceFactory
public static final String DEFAULT_NAME
protected HibernateBundle(List<Class<?>> entities, SessionFactoryFactory sessionFactoryFactory)
public final void initialize(Bootstrap<?> bootstrap)
ConfiguredBundle
initialize
in interface ConfiguredBundle<T>
bootstrap
- the application bootstrapprotected com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module createHibernate5Module()
Hibernate5Module
.protected String name()
public final void run(T configuration, Environment environment) throws Exception
ConfiguredBundle
run
in interface ConfiguredBundle<T>
configuration
- the configuration objectenvironment
- the application's Environment
Exception
- if something goes wrongpublic boolean isLazyLoadingEnabled()
public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)
public org.hibernate.SessionFactory getSessionFactory()
protected void configure(org.hibernate.cfg.Configuration configuration)
Copyright © 2019. All rights reserved.