Package com.yammer.dropwizard.db

Examples of com.yammer.dropwizard.db.Database


  @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));
    environment.addResource(new HtmlPageResource());
  }
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

Related Classes of com.yammer.dropwizard.db.Database

Copyright © 2018 www.massapicom. 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.