Package io.dropwizard.hibernate
Class ScanningHibernateBundle<T>
java.lang.Object
io.dropwizard.hibernate.HibernateBundle<T>
io.dropwizard.hibernate.ScanningHibernateBundle<T>
- All Implemented Interfaces:
ConfiguredBundle<T>
,DatabaseConfiguration<T>
Extension of HibernateBundle that scans given package for entities instead of giving them by hand.
-
Field Summary
Fields inherited from class io.dropwizard.hibernate.HibernateBundle
DEFAULT_NAME, entities, lazyLoadingEnabled, sessionFactory, sessionFactoryFactory
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
ScanningHibernateBundle
(String[] pckgs, SessionFactoryFactory sessionFactoryFactory) protected
ScanningHibernateBundle
(String pckg, SessionFactoryFactory sessionFactoryFactory) -
Method Summary
Modifier and TypeMethodDescriptionfindEntityClassesFromDirectory
(String[] pckgs) Method scanning given directory for classes containing Hibernate @Entity annotationMethods inherited from class io.dropwizard.hibernate.HibernateBundle
configure, createHibernate5Module, getSessionFactory, initialize, isLazyLoadingEnabled, name, registerUnitOfWorkListenerIfAbsent, run, 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
-
Constructor Details
-
ScanningHibernateBundle
- Parameters:
pckg
- string with package containing Hibernate entities (classes annotated with Hibernate@Entity
annotation) e. g.com.codahale.fake.db.directory.entities
-
ScanningHibernateBundle
-
ScanningHibernateBundle
-
-
Method Details
-
findEntityClassesFromDirectory
Method scanning given directory for classes containing Hibernate @Entity annotation- Parameters:
pckgs
- string array with packages containing Hibernate entities (classes annotated with @Entity annotation) e.g. com.codahale.fake.db.directory.entities- Returns:
- ImmutableList with classes from given directory annotated with Hibernate @Entity annotation
-