Search in sources :

Example 1 with BindKripton180BeanInsertSelectDataSource

use of sqlite.feature.typeadapter.kripton180.bean.insertselect.BindKripton180BeanInsertSelectDataSource in project kripton by xcesco.

the class TestKripton180BeanInsertSelectRuntime method testRun.

@Test
public void testRun() {
    final Employee bean = new Employee();
    bean.birthDate = new java.sql.Date((new java.util.Date()).getTime());
    bean.fieldBoolean = "true";
    bean.fieldByte = "42";
    bean.fieldByteArray = "42";
    bean.fieldCharacter = "a";
    bean.fieldDouble = "120";
    bean.fieldFloat = "120";
    bean.fieldInteger = "11";
    bean.fieldLong = "13";
    bean.fieldShort = "2";
    bean.fieldString = "a";
    bean.hireDate = new java.sql.Date((new java.util.Date()).getTime());
    BindKripton180BeanInsertSelectDataSource dataSource = BindKripton180BeanInsertSelectDataSource.instance();
    dataSource.execute(new BindKripton180BeanInsertSelectDataSource.Transaction() {

        @Override
        public TransactionResult onExecute(BindKripton180BeanInsertSelectDaoFactory daoFactory) {
            EmployeeBeanInsertSelectDaoImpl dao = daoFactory.getEmployeeBeanInsertSelectDao();
            dao.insertJQL(bean);
            Assert.assertTrue(bean.id > 0);
            return TransactionResult.ROLLBACK;
        }
    });
}
Also used : TransactionResult(com.abubusoft.kripton.android.sqlite.TransactionResult) EmployeeBeanInsertSelectDaoImpl(sqlite.feature.typeadapter.kripton180.bean.insertselect.EmployeeBeanInsertSelectDaoImpl) BindKripton180BeanInsertSelectDataSource(sqlite.feature.typeadapter.kripton180.bean.insertselect.BindKripton180BeanInsertSelectDataSource) BindKripton180BeanInsertSelectDaoFactory(sqlite.feature.typeadapter.kripton180.bean.insertselect.BindKripton180BeanInsertSelectDaoFactory) Test(org.junit.Test) BaseAndroidTest(base.BaseAndroidTest)

Aggregations

BaseAndroidTest (base.BaseAndroidTest)1 TransactionResult (com.abubusoft.kripton.android.sqlite.TransactionResult)1 Test (org.junit.Test)1 BindKripton180BeanInsertSelectDaoFactory (sqlite.feature.typeadapter.kripton180.bean.insertselect.BindKripton180BeanInsertSelectDaoFactory)1 BindKripton180BeanInsertSelectDataSource (sqlite.feature.typeadapter.kripton180.bean.insertselect.BindKripton180BeanInsertSelectDataSource)1 EmployeeBeanInsertSelectDaoImpl (sqlite.feature.typeadapter.kripton180.bean.insertselect.EmployeeBeanInsertSelectDaoImpl)1