Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created November 6, 2015 13:11
Show Gist options
  • Select an option

  • Save javaeeeee/43f0e86d1426828f8407 to your computer and use it in GitHub Desktop.

Select an option

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
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