Package io.dropwizard.hibernate.dual
Class HibernateBundle<T>
- java.lang.Object
-
- io.dropwizard.hibernate.HibernateBundle<T>
-
- io.dropwizard.hibernate.dual.HibernateBundle<T>
-
- All Implemented Interfaces:
ConfiguredBundle<T>,DatabaseConfiguration<T>
public abstract class HibernateBundle<T> extends HibernateBundle<T>
-
-
Field Summary
Fields Modifier and Type Field Description static StringPRIMARYstatic StringREADER-
Fields inherited from class io.dropwizard.hibernate.HibernateBundle
DEFAULT_NAME, entities, lazyLoadingEnabled, sessionFactory, sessionFactoryFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHibernateBundle(Class<?> entity, Class<?>... entities)protectedHibernateBundle(List<Class<?>> entities, SessionFactoryFactory sessionFactoryFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract PooledDataSourceFactorygetReadSourceFactory(T configuration)voidrun(T configuration, Environment environment)Initializes the environment.-
Methods inherited from class io.dropwizard.hibernate.HibernateBundle
configure, createHibernate5Module, getSessionFactory, initialize, isLazyLoadingEnabled, name, registerUnitOfWorkListenerIfAbsent, setLazyLoadingEnabled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.dropwizard.db.DatabaseConfiguration
getDataSourceFactory
-
-
-
-
Field Detail
-
PRIMARY
public static final String PRIMARY
- See Also:
- Constant Field Values
-
READER
public static final String READER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HibernateBundle
protected HibernateBundle(List<Class<?>> entities, SessionFactoryFactory sessionFactoryFactory)
-
-
Method Detail
-
getReadSourceFactory
public abstract PooledDataSourceFactory getReadSourceFactory(T configuration)
-
run
public void run(T configuration, Environment environment) throws Exception
Description copied from interface:ConfiguredBundleInitializes the environment.- Specified by:
runin interfaceConfiguredBundle<T>- Overrides:
runin classHibernateBundle<T>- Parameters:
configuration- the configuration objectenvironment- the application'sEnvironment- Throws:
Exception- if something goes wrong
-
-