public abstract class HibernateTransactionalBundle<T extends io.dropwizard.Configuration> extends Object implements io.dropwizard.ConfiguredBundle<T>, io.dropwizard.db.DatabaseConfiguration<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAME |
| Modifier | Constructor and Description |
|---|---|
protected |
HibernateTransactionalBundle(Class<?> entity,
Class<?>... entities) |
protected |
HibernateTransactionalBundle(com.google.common.collect.ImmutableList<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(io.dropwizard.setup.Bootstrap<?> 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,
io.dropwizard.setup.Environment environment) |
void |
setLazyLoadingEnabled(boolean lazyLoadingEnabled) |
public static final String DEFAULT_NAME
protected HibernateTransactionalBundle(Class<?> entity, Class<?>... entities)
protected HibernateTransactionalBundle(com.google.common.collect.ImmutableList<Class<?>> entities, SessionFactoryFactory sessionFactoryFactory)
public final void initialize(io.dropwizard.setup.Bootstrap<?> bootstrap)
initialize in interface io.dropwizard.ConfiguredBundle<T extends io.dropwizard.Configuration>protected com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module createHibernate5Module()
Hibernate5Module.protected String name()
public final void run(T configuration, io.dropwizard.setup.Environment environment) throws Exception
public boolean isLazyLoadingEnabled()
public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)
public org.hibernate.SessionFactory getSessionFactory()
protected void configure(org.hibernate.cfg.Configuration configuration)
Copyright © 2020. All rights reserved.