Created
November 6, 2015 13:08
-
-
Save javaeeeee/7ae1cddc855ac891dd46 to your computer and use it in GitHub Desktop.
Adding Hibernate bundle to the Dropwizard Application class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DWGettingStartedApplication | |
| extends Application<DWGettingStartedConfiguration> { | |
| /** | |
| * Hibernate bundle. | |
| */ | |
| private final HibernateBundle<DWGettingStartedConfiguration> hibernateBundle | |
| = new HibernateBundle<DWGettingStartedConfiguration>( | |
| Employee.class | |
| ) { | |
| @Override | |
| public DataSourceFactory getDataSourceFactory( | |
| DWGettingStartedConfiguration configuration | |
| ) { | |
| return configuration.getDataSourceFactory(); | |
| } | |
| }; | |
| ... | |
| @Override | |
| public void initialize( | |
| final Bootstrap<DWGettingStartedConfiguration> bootstrap) { | |
| bootstrap.addBundle(hibernateBundle); | |
| } | |
| ... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment