Examples of onDemand()


Examples of com.yammer.dropwizard.db.Database.onDemand()

                            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

Examples of com.yammer.dropwizard.db.Database.onDemand()

    @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

Examples of org.skife.jdbi.v2.DBI.onDemand()

    @Override
    public void run(PizzaConfiguration config, Environment environment) throws ClassNotFoundException {
        final DBIFactory factory = new DBIFactory();
        final DBI jdbi = factory.build(environment, config.getDatabaseConfiguration(), "postgresql");
        final ToppingDAO dao = jdbi.onDemand(ToppingDAO.class);
        final PizzaDAO pizza_dao = jdbi.onDemand(PizzaDAO.class);
        environment.addResource(new ToppingResource(dao));
        environment.addResource(new PizzaResource(pizza_dao));
    }
}
View Full Code Here

Examples of org.skife.jdbi.v2.DBI.onDemand()

    @Override
    public void run(PizzaConfiguration config, Environment environment) throws ClassNotFoundException {
        final DBIFactory factory = new DBIFactory();
        final DBI jdbi = factory.build(environment, config.getDatabaseConfiguration(), "postgresql");
        final ToppingDAO dao = jdbi.onDemand(ToppingDAO.class);
        final PizzaDAO pizza_dao = jdbi.onDemand(PizzaDAO.class);
        environment.addResource(new ToppingResource(dao));
        environment.addResource(new PizzaResource(pizza_dao));
    }
}
View Full Code Here

Examples of org.skife.jdbi.v2.DBI.onDemand()

    @Override
    protected void run(Environment environment, Namespace namespace, PizzaConfiguration config) throws Exception {
        final DBIFactory factory = new DBIFactory();
        final DBI jdbi = factory.build(environment, config.getDatabaseConfiguration(), "postgresql");
        final ToppingDAO dao = jdbi.onDemand(ToppingDAO.class);
        final PizzaDAO pizza_dao = jdbi.onDemand(PizzaDAO.class);

        // toppings
        dao.deleteAll();
        long t_mushroom = dao.insert("Mushroom");
View Full Code Here

Examples of org.skife.jdbi.v2.DBI.onDemand()

    @Override
    protected void run(Environment environment, Namespace namespace, PizzaConfiguration config) throws Exception {
        final DBIFactory factory = new DBIFactory();
        final DBI jdbi = factory.build(environment, config.getDatabaseConfiguration(), "postgresql");
        final ToppingDAO dao = jdbi.onDemand(ToppingDAO.class);
        final PizzaDAO pizza_dao = jdbi.onDemand(PizzaDAO.class);

        // toppings
        dao.deleteAll();
        long t_mushroom = dao.insert("Mushroom");
        long t_onion = dao.insert("Onion");
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.