public abstract class EntityManagerBundle<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 |
EntityManagerBundle(Class<?> entity,
Class<?>... entities) |
protected |
EntityManagerBundle(com.google.common.collect.ImmutableList<Class<?>> entities,
EntityManagerFactoryFactory entityManagerFactoryFactory,
com.scottescue.dropwizard.entitymanager.SharedEntityManagerFactory sharedEntityManagerFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
configure(PersistenceUnitConfig configuration)
Override to configure JPA persistence unit.
|
protected com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module |
createHibernate4Module()
Override to configure the
Hibernate4Module . |
javax.persistence.EntityManagerFactory |
getEntityManagerFactory() |
javax.persistence.EntityManager |
getSharedEntityManager() |
void |
initialize(io.dropwizard.setup.Bootstrap<?> bootstrap) |
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) |
public static final String DEFAULT_NAME
protected EntityManagerBundle(com.google.common.collect.ImmutableList<Class<?>> entities, EntityManagerFactoryFactory entityManagerFactoryFactory, com.scottescue.dropwizard.entitymanager.SharedEntityManagerFactory sharedEntityManagerFactory)
public void initialize(io.dropwizard.setup.Bootstrap<?> bootstrap)
initialize
in interface io.dropwizard.ConfiguredBundle<T extends io.dropwizard.Configuration>
public javax.persistence.EntityManagerFactory getEntityManagerFactory()
public javax.persistence.EntityManager getSharedEntityManager()
protected com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module createHibernate4Module()
Hibernate4Module
.protected String name()
protected void configure(PersistenceUnitConfig configuration)
configuration
- the persistence unit configurationCopyright © 2016. All rights reserved.