Search in sources :

Example 6 with SqlObjectPlugin

use of org.jdbi.v3.sqlobject.SqlObjectPlugin in project jdbi by jdbi.

the class BindListNullTest method init.

@BeforeClass
public static void init() {
    final Jdbi db = dbRule.getJdbi();
    db.registerRowMapper(new SomethingMapper());
    db.installPlugin(new SqlObjectPlugin());
    handle = db.open();
    handle.execute("insert into something(id, name) values(1, null)");
    handle.execute("insert into something(id, name) values(2, null)");
    handle.execute("insert into something(id, name) values(3, null)");
    handle.execute("insert into something(id, name) values(4, null)");
    handle.execute("insert into something(id, name) values(5, 'bla')");
    handle.execute("insert into something(id, name) values(6, 'null')");
    handle.execute("insert into something(id, name) values(7, '')");
}
Also used : SomethingMapper(org.jdbi.v3.core.mapper.SomethingMapper) Jdbi(org.jdbi.v3.core.Jdbi) BeforeClass(org.junit.BeforeClass)

Example 7 with SqlObjectPlugin

use of org.jdbi.v3.sqlobject.SqlObjectPlugin in project jdbi by jdbi.

the class BindListTest method init.

@BeforeClass
public static void init() {
    final Jdbi db = dbRule.getJdbi();
    db.installPlugin(new SqlObjectPlugin());
    db.registerRowMapper(new SomethingMapper());
    handle = db.open();
    handle.execute("insert into something(id, name) values(1, '1')");
    handle.execute("insert into something(id, name) values(2, '2')");
    // "control group" element that should *not* be returned by the queries
    handle.execute("insert into something(id, name) values(3, '3')");
    expectedSomethings = Arrays.asList(new Something(1, "1"), new Something(2, "2"));
}
Also used : SomethingMapper(org.jdbi.v3.core.mapper.SomethingMapper) Jdbi(org.jdbi.v3.core.Jdbi) Something(org.jdbi.v3.core.Something) BeforeClass(org.junit.BeforeClass)

Aggregations

SomethingMapper (org.jdbi.v3.core.mapper.SomethingMapper)6 Jdbi (org.jdbi.v3.core.Jdbi)4 JdbcDataSource (org.h2.jdbcx.JdbcDataSource)3 Before (org.junit.Before)3 BeforeClass (org.junit.BeforeClass)3 Something (org.jdbi.v3.core.Something)2 Connection (java.sql.Connection)1 SqlObjectPlugin (org.jdbi.v3.sqlobject.SqlObjectPlugin)1 Test (org.junit.Test)1