use of sqlite.kripton58.list.BindLongDataSource.Transaction in project kripton by xcesco.
the class Test58Runtime method testRunSqlite1.
@Test
public void testRunSqlite1() {
BindLongDataSource dataSource = BindLongDataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindLongDaoFactory daoFactory) {
LongDaoImpl dao = daoFactory.getLongDao();
ArrayList<Long> value = new ArrayList<Long>();
value.add(45L);
LongBean bean = new LongBean();
bean.value = value;
dao.insert(bean);
// retrieve same value
List<LongBean> result = dao.selectList(value);
assertTrue(result.size() == 1);
return TransactionResult.COMMIT;
}
});
}
Aggregations