use of sqlite.feature.foreignKey.BindDummyDataSource.Transaction in project kripton by xcesco.
the class TestForeignKeyARuntime method testRunSqlite2.
@Test
public void testRunSqlite2() throws IOException, InstantiationException, IllegalAccessException {
BindDummyDataSource dataSource = BindDummyDataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindDummyDaoFactory daoFactory) {
DaoBeanA_1Impl dao = daoFactory.getDaoBeanA_1();
BeanA_2 beanParent = new BeanA_2();
beanParent.valueString2 = "parent";
daoFactory.getDaoBeanA_2().insert(beanParent);
BeanA_1 bean = new BeanA_1();
bean.valueString = "hello";
bean.beanA2Id = beanParent.id;
dao.insert(bean);
assertEquals(1, bean.id);
return TransactionResult.COMMIT;
}
});
}
use of sqlite.feature.foreignKey.BindDummyDataSource.Transaction in project kripton by xcesco.
the class TestForeignKeyARuntime method testRunSqlite1.
@Test
public void testRunSqlite1() throws IOException, InstantiationException, IllegalAccessException {
BindDummyDataSource dataSource = BindDummyDataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindDummyDaoFactory daoFactory) {
DaoBeanA_1Impl dao = daoFactory.getDaoBeanA_1();
BeanA_2 beanParent = new BeanA_2();
beanParent.valueString2 = "parent";
daoFactory.getDaoBeanA_2().insert(beanParent);
BeanA_1 bean = new BeanA_1();
bean.valueString = "hello";
bean.beanA2Id = beanParent.id;
dao.insert(bean);
assertEquals(1, bean.id);
List<BeanA_1> list = dao.selectById(bean.id);
Assert.assertEquals("not one ", 1, list.size());
return TransactionResult.COMMIT;
}
});
}
use of sqlite.feature.foreignKey.BindDummyDataSource.Transaction in project kripton by xcesco.
the class TestForeignKeyARuntime method testRunSqlite3.
@Test
public void testRunSqlite3() throws IOException, InstantiationException, IllegalAccessException {
BindDummyDataSource dataSource = BindDummyDataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindDummyDaoFactory daoFactory) {
DaoBeanA_1Impl dao = daoFactory.getDaoBeanA_1();
BeanA_2 beanParent = new BeanA_2();
beanParent.valueString2 = "parent";
daoFactory.getDaoBeanA_2().insert(beanParent);
BeanA_1 bean = new BeanA_1();
bean.valueString = "hello";
bean.beanA2Id = beanParent.id;
dao.insert(bean);
assertEquals(1, bean.id);
return TransactionResult.COMMIT;
}
});
}
use of sqlite.feature.foreignKey.BindDummyDataSource.Transaction in project kripton by xcesco.
the class TestForeignKeyARuntime method testRunSqlite4.
@Test
public void testRunSqlite4() throws IOException, InstantiationException, IllegalAccessException {
BindDummyDataSource dataSource = BindDummyDataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindDummyDaoFactory daoFactory) {
DaoBeanA_1Impl dao = daoFactory.getDaoBeanA_1();
BeanA_2 beanParent = new BeanA_2();
beanParent.valueString2 = "parent";
daoFactory.getDaoBeanA_2().insert(beanParent);
BeanA_1 bean = new BeanA_1();
bean.valueString = "hello";
bean.beanA2Id = beanParent.id;
dao.insert(bean);
assertEquals(1, bean.id);
return TransactionResult.COMMIT;
}
});
}
Aggregations