use of sqlite.feature.jql.persistence.BindFamilyDaoFactory in project kripton by xcesco.
the class TestFeatJQLRuntime method testJQL1.
@Test
public void testJQL1() {
BindFamilyDataSource dataSource = BindFamilyDataSource.instance();
// transaction to insert elements
dataSource.execute(new BindFamilyDataSource.Transaction() {
@Override
public TransactionResult onExecute(BindFamilyDaoFactory daoFactory) {
// TODO Auto-generated method stub
Person person = new Person();
person.name = "Tonj Manero";
daoFactory.getDaoPerson().insertBean(person);
Child child = new Child();
child.name = "Luna";
child.parentId = person.id;
daoFactory.getDaoChild().insertBean(child);
daoFactory.getDaoChild().insertBean(child);
List<Child> list = daoFactory.getDaoChild().selectByParent(person.id);
assertTrue(2 == list.size());
for (int i = 0; i < list.size(); i++) {
assertTrue(list.get(i).name.equals("Luna"));
}
return TransactionResult.COMMIT;
}
});
}
Aggregations