Search in sources :

Example 1 with SomethingDao

use of org.jdbi.v3.sqlobject.subpackage.SomethingDao in project jdbi by jdbi.

the class TestSqlObject method testPassThroughMethodWithDaoInAnotherPackage.

@Test
public void testPassThroughMethodWithDaoInAnotherPackage() throws Exception {
    SomethingDao dao = handle.attach(SomethingDao.class);
    dao.insert(3, "Cora");
    Something c = dao.findByIdHeeHee(3);
    assertThat(c).isEqualTo(new Something(3, "Cora"));
}
Also used : SomethingDao(org.jdbi.v3.sqlobject.subpackage.SomethingDao) Something(org.jdbi.v3.core.Something) Test(org.junit.Test)

Example 2 with SomethingDao

use of org.jdbi.v3.sqlobject.subpackage.SomethingDao in project jdbi by jdbi.

the class TestSqlObject method testSimpleTransactionsSucceed.

@Test
public void testSimpleTransactionsSucceed() throws Exception {
    SomethingDao dao = dbRule.getJdbi().onDemand(SomethingDao.class);
    dao.insertInSingleTransaction(10, "Linda");
}
Also used : SomethingDao(org.jdbi.v3.sqlobject.subpackage.SomethingDao) Test(org.junit.Test)

Example 3 with SomethingDao

use of org.jdbi.v3.sqlobject.subpackage.SomethingDao in project jdbi by jdbi.

the class TestUseCustomHandlerFactory method shouldUseConfiguredDefaultHandler.

@Test
public void shouldUseConfiguredDefaultHandler() throws Exception {
    SomethingDao h = handle.attach(SomethingDao.class);
    Something s = h.insertAndFind(new Something(1, "Joy"));
    assertThat(s.getName()).isEqualTo("Joy");
}
Also used : Something(org.jdbi.v3.core.Something) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 Something (org.jdbi.v3.core.Something)2 SomethingDao (org.jdbi.v3.sqlobject.subpackage.SomethingDao)2