Search in sources :

Example 1 with Transaction

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;
        }
    });
}
Also used : TransactionResult(com.abubusoft.kripton.android.sqlite.TransactionResult) Transaction(sqlite.kripton58.list.BindLongDataSource.Transaction) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Test(org.junit.Test) BaseAndroidTest(base.BaseAndroidTest)

Aggregations

BaseAndroidTest (base.BaseAndroidTest)1 TransactionResult (com.abubusoft.kripton.android.sqlite.TransactionResult)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Test (org.junit.Test)1 Transaction (sqlite.kripton58.list.BindLongDataSource.Transaction)1