Package com.yammer.dropwizard.db

Examples of com.yammer.dropwizard.db.DatabaseFactory.build()


  @Override
  protected void initialize(TodoServiceConfiguration configuration,
                            Environment environment) throws Exception {

    final DatabaseFactory factory = new DatabaseFactory(environment);
    Database database = factory.build(configuration.getDatabase(), "todo");

    final TodoDao dao = database.onDemand(TodoDao.class);
    dao.createTableIfNotExists();

    environment.addResource(new TodoResource(dao));
View Full Code Here


    }

    @Override
    protected void initialize(AuthConfiguration config, Environment environment) throws Exception {
        final DatabaseFactory factory = new DatabaseFactory(environment);
        final Database db = factory.build(config.getDatabaseConfiguration(), "postgresql");

        final UserDAO userDAO = db.onDemand(UserDAO.class);
        environment.addResource(new AuthResource(userDAO));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.