use of org.jdbi.v3.core.Something in project jdbi by jdbi.
the class TestUseClasspathSqlLocator method testBam.
@Test
public void testBam() throws Exception {
Something s = handle.attach(Cromulence.class).findById(6L);
assertThat(s.getName()).isEqualTo("Martin");
}
use of org.jdbi.v3.core.Something in project jdbi by jdbi.
the class TestUseClasspathSqlLocator method testOverride.
@Test
public void testOverride() throws Exception {
Something s = handle.attach(SubCromulence.class).findById(6L);
assertThat(s.getName()).isEqualTo("overridden");
}
use of org.jdbi.v3.core.Something in project jdbi by jdbi.
the class TestVariousOddities method testAttach.
@Test
public void testAttach() throws Exception {
Spiffy s = dbRule.getSharedHandle().attach(Spiffy.class);
s.insert(new Something(14, "Tom"));
Something tom = s.byId(14);
assertThat(tom.getName()).isEqualTo("Tom");
}
use of org.jdbi.v3.core.Something in project jdbi by jdbi.
the class TestRegisteredMappersWork method testNoErrorOnNoData.
@Test
public void testNoErrorOnNoData() throws Exception {
Kabob bob = dbRule.getJdbi().onDemand(Kabob.class);
Something henning = bob.find(1);
assertThat(henning).isNull();
List<Something> rs = bob.listAll();
assertThat(rs).isEmpty();
}
use of org.jdbi.v3.core.Something in project jdbi by jdbi.
the class TestRegisteredMappersWork method testNoRootRegistrations.
@Test(expected = NoSuchMapperException.class)
public void testNoRootRegistrations() throws Exception {
try (Handle h = dbRule.openHandle()) {
h.execute("insert into something (id, name) values (1, 'Henning')");
h.createQuery("select id, name from something where id = 1").mapTo(Something.class).findFirst();
}
}
Aggregations