Search in sources :

Example 1 with FortuneRepository

use of com.example.helloworld.db.jdbi.FortuneRepository in project FrameworkBenchmarks by TechEmpower.

the class HelloJDBIService method run.

@Override
public void run(HelloWorldConfiguration config, Environment environment) {
    final JdbiFactory factory = new JdbiFactory();
    final Jdbi jdbi = factory.build(environment, config.getDatabaseConfiguration(), "RDBMS");
    // Test type 1: JSON serialization and Test type 6: Plaintext are tested against HelloWorldService class
    // Test types 2, 3 & 5: Single database query, Multiple database queries & Database updates
    environment.jersey().register(new WorldResource(new WorldRepository(jdbi)));
    // Test type 4: Fortunes
    environment.jersey().register(new FortuneResource(new FortuneRepository(jdbi)));
}
Also used : Jdbi(org.jdbi.v3.core.Jdbi) WorldResource(com.example.helloworld.resources.WorldResource) JdbiFactory(io.dropwizard.jdbi3.JdbiFactory) FortuneResource(com.example.helloworld.resources.FortuneResource) WorldRepository(com.example.helloworld.db.jdbi.WorldRepository) FortuneRepository(com.example.helloworld.db.jdbi.FortuneRepository)

Aggregations

FortuneRepository (com.example.helloworld.db.jdbi.FortuneRepository)1 WorldRepository (com.example.helloworld.db.jdbi.WorldRepository)1 FortuneResource (com.example.helloworld.resources.FortuneResource)1 WorldResource (com.example.helloworld.resources.WorldResource)1 JdbiFactory (io.dropwizard.jdbi3.JdbiFactory)1 Jdbi (org.jdbi.v3.core.Jdbi)1