Created
November 6, 2015 13:11
-
-
Save javaeeeee/43f0e86d1426828f8407 to your computer and use it in GitHub Desktop.
Registering a database-backed resource class in the Application class of a Dropwizard project
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> { | |
| ... | |
| @Override | |
| public void run(final DWGettingStartedConfiguration configuration, | |
| final Environment environment) { | |
| final EmployeeDAO employeeDAO | |
| = new EmployeeDAO(hibernateBundle.getSessionFactory()); | |
| ... | |
| environment.jersey().register(new EmployeesResource(employeeDAO)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment